kaori 4 лет назад
Родитель
Сommit
b564d0f131
1 измененных файлов с 5 добавлено и 3 удалено
  1. 5 3
      packages/app/src/server/models/notification.ts

+ 5 - 3
packages/app/src/server/models/notification.ts

@@ -195,9 +195,11 @@ export default (crowi: Crowi) => {
   };
 
   notificationEvent.on('update', (user) => {
-    const io = crowi.getSocketIoService();
-    if (io != null) {
-      io.sockets.emit('notification updated', { user });
+    const { socketIoService } = crowi;
+    socketIoService.getDefaultSocket();
+
+    if (socketIoService.isInitialized) {
+      socketIoService.getDefaultSocket().emit('notification updated', { user });
     }
   });