kaori 4 лет назад
Родитель
Сommit
916ba56119

+ 1 - 3
packages/app/src/components/InAppNotification/InAppNotificationDropdown.tsx

@@ -28,9 +28,7 @@ const InAppNotificationDropdown: FC<Props> = (props: Props) => {
 
   const initializeSocket = (props) => {
     const socket = props.socketIoContainer.getSocket();
-    // いらなくないこれ?
-    socket.on('notificationUpdated', (data: { userId: string, count: number }) => {
-      console.log('hogee');
+    socket.on('notificationUpdated', () => {
       mutateInAppNotificationStatusData();
     });
   };

+ 1 - 2
packages/app/src/server/service/in-app-notification.ts

@@ -42,12 +42,11 @@ export default class InAppNotificationService {
   emitSocketIo = async(targetUsers) => {
     if (this.socketIoService.isInitialized) {
       targetUsers.forEach(async(userId) => {
-        const count = await this.getUnreadCountByUser(userId);
 
         // emit to the room for each user
         await this.socketIoService.getDefaultSocket()
           .in(getRoomNameWithId(RoomPrefix.USER, userId))
-          .emit('notificationUpdated', { userId, count });
+          .emit('notificationUpdated');
       });
     }
   }