Shun Miyazawa 4 سال پیش
والد
کامیت
d3849b75b1
1فایلهای تغییر یافته به همراه4 افزوده شده و 6 حذف شده
  1. 4 6
      packages/app/src/server/routes/apiv3/page.js

+ 4 - 6
packages/app/src/server/routes/apiv3/page.js

@@ -255,6 +255,10 @@ module.exports = (crowi) => {
     res.apiv3({ result });
 
     if (isLiked) {
+      const pageEvent = crowi.event('page');
+      // in-app notification
+      pageEvent.emit('like', page, req.user);
+
       try {
         // global notification
         await globalNotificationService.fire(GlobalNotificationSetting.EVENT.PAGE_LIKE, page, req.user);
@@ -263,12 +267,6 @@ module.exports = (crowi) => {
         logger.error('Like notification failed', err);
       }
     }
-
-    if (isLiked) {
-      const pageEvent = crowi.event('page');
-      // in-app notification
-      pageEvent.emit('like', page, req.user);
-    }
   });
 
   /**