|
|
@@ -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 });
|
|
|
}
|
|
|
});
|
|
|
|