Shun Miyazawa 2 лет назад
Родитель
Сommit
0479f699d5
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      apps/app/src/components/Sidebar/SidebarNav/PrimaryItems.tsx

+ 3 - 1
apps/app/src/components/Sidebar/SidebarNav/PrimaryItems.tsx

@@ -119,6 +119,8 @@ export const PrimaryItemsForNotification = memo((props: Props) => {
 
   const { data: notificationCount, mutate: mutateNotificationCount } = useSWRxInAppNotificationStatus();
 
+  const badgeContents = notificationCount != null && notificationCount > 0 ? notificationCount : undefined;
+
   useEffect(() => {
     if (socket != null) {
       socket.on('notificationUpdated', () => {
@@ -145,7 +147,7 @@ export const PrimaryItemsForNotification = memo((props: Props) => {
         label="In-App Notification"
         iconName="notifications"
         onHover={onItemHover}
-        badgeContents={notificationCount != null && notificationCount > 0 ? notificationCount : undefined}
+        badgeContents={badgeContents}
       />
     </div>
   );