From 5b9d22e2c5b339cadc54e0742f7d1d8c963e4a6a Mon Sep 17 00:00:00 2001 From: eugenijm Date: Fri, 17 Jul 2020 12:01:01 +0300 Subject: [PATCH] Fix the notifications polling when all the latest notifications are unread --- .../notifications_fetcher/notifications_fetcher.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js index d282074a..80be02ca 100644 --- a/src/services/notifications_fetcher/notifications_fetcher.service.js +++ b/src/services/notifications_fetcher/notifications_fetcher.service.js @@ -35,7 +35,7 @@ const fetchAndUpdate = ({ store, credentials, older = false }) => { const notifications = timelineData.data const readNotifsIds = notifications.filter(n => n.seen).map(n => n.id) const numUnseenNotifs = notifications.length - readNotifsIds.length - if (numUnseenNotifs > 0) { + if (numUnseenNotifs > 0 && readNotifsIds.length > 0) { args['since'] = Math.max(...readNotifsIds) fetchNotifications({ store, args, older }) }