Browse Source

small fix

Shun Miyazawa 2 years ago
parent
commit
0479f699d5
1 changed files with 3 additions and 1 deletions
  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 { data: notificationCount, mutate: mutateNotificationCount } = useSWRxInAppNotificationStatus();
 
 
+  const badgeContents = notificationCount != null && notificationCount > 0 ? notificationCount : undefined;
+
   useEffect(() => {
   useEffect(() => {
     if (socket != null) {
     if (socket != null) {
       socket.on('notificationUpdated', () => {
       socket.on('notificationUpdated', () => {
@@ -145,7 +147,7 @@ export const PrimaryItemsForNotification = memo((props: Props) => {
         label="In-App Notification"
         label="In-App Notification"
         iconName="notifications"
         iconName="notifications"
         onHover={onItemHover}
         onHover={onItemHover}
-        badgeContents={notificationCount != null && notificationCount > 0 ? notificationCount : undefined}
+        badgeContents={badgeContents}
       />
       />
     </div>
     </div>
   );
   );