From d03dbaa56e913ff8744ce8a4c9e97ed385cdea65 Mon Sep 17 00:00:00 2001 From: yoution Date: Wed, 22 Jan 2020 11:45:01 +0800 Subject: [PATCH] #3455 In app notifications are sent though they are turned off #3455 --- src/services/NotificationService.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/NotificationService.js b/src/services/NotificationService.js index cb92781..daea260 100644 --- a/src/services/NotificationService.js +++ b/src/services/NotificationService.js @@ -205,8 +205,8 @@ function* listNotifications(query, userId) { if (_.keys(notificationSettings).length > 0) { // only filter out notifications types which were explicitly set to 'no' - so we return notification by default const notifications = _.keys(notificationSettings).filter((notificationType) => - !notificationSettings[notificationType] && - !notificationSettings[notificationType].web && + notificationSettings[notificationType] && + notificationSettings[notificationType].web && notificationSettings[notificationType].web.enabled === 'no' ); filter.where.type = Object.assign(filter.where.type || {}, { $notIn: notifications });