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

+ 2 - 1
packages/app/src/server/crowi/index.js

@@ -309,7 +309,8 @@ Crowi.prototype.scanRuntimeVersions = async function() {
 };
 
 Crowi.prototype.getSocketIoService = function() {
-  return this.socketIoService;
+  const socket = this.socketIoService.getDefaultSocket();
+  return socket;
 };
 
 Crowi.prototype.getSlack = function() {

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

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