Shun Miyazawa 3 лет назад
Родитель
Сommit
5d9b629433

+ 1 - 5
packages/app/src/server/service/activity.ts

@@ -40,11 +40,7 @@ class ActivityService {
         return;
       }
 
-      // create inAppNotification
-      const shouldNotification = (AllSupportedActionToNotifiedType as ReadonlyArray<string>).includes(activity.action);
-      if (shouldNotification) {
-        this.activityEvent.emit('createInAppNotification', activity, target);
-      }
+      this.activityEvent.emit('updated', activity, target);
     });
   }
 

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

@@ -49,7 +49,7 @@ export default class InAppNotificationService {
   }
 
   initActivityEventListeners(): void {
-    this.activityEvent.on('createInAppNotification', async(activity: ActivityDocument, target: IPage) => {
+    this.activityEvent.on('updated', async(activity: ActivityDocument, target: IPage) => {
       try {
         await this.createInAppNotification(activity, target);
       }