kaori пре 4 година
родитељ
комит
f14754d870
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      packages/app/src/server/models/in-app-notification.ts

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

@@ -139,7 +139,7 @@ export default (crowi: Crowi) => {
 
 
     const inAppNotification = await InAppNotification.findOneAndUpdate(query, parameters, options);
     const inAppNotification = await InAppNotification.findOneAndUpdate(query, parameters, options);
 
 
-    if (inAppNotification) {
+    if (inAppNotification != null) {
       commentEvent.emit('update', inAppNotification.user);
       commentEvent.emit('update', inAppNotification.user);
     }
     }
 
 
@@ -174,7 +174,7 @@ export default (crowi: Crowi) => {
     const options = { new: true };
     const options = { new: true };
 
 
     const inAppNotification = await InAppNotification.findOneAndUpdate(query, parameters, options);
     const inAppNotification = await InAppNotification.findOneAndUpdate(query, parameters, options);
-    if (inAppNotification) {
+    if (inAppNotification != null) {
       commentEvent.emit('update', inAppNotification.user);
       commentEvent.emit('update', inAppNotification.user);
     }
     }
     return inAppNotification;
     return inAppNotification;