aboutsummaryrefslogtreecommitdiff
path: root/src/services/notifications_fetcher
diff options
context:
space:
mode:
authoreugenijm <eugenijm@protonmail.com>2020-07-17 12:01:01 +0300
committereugenijm <eugenijm@protonmail.com>2020-07-17 18:27:47 +0300
commit5b9d22e2c5b339cadc54e0742f7d1d8c963e4a6a (patch)
tree381a0ad42534715a54ad88e5d031810a9991a948 /src/services/notifications_fetcher
parent950ae6d89a95e74e74b3f2e5abcd9233c3db8958 (diff)
Fix the notifications polling when all the latest notifications are unread
Diffstat (limited to 'src/services/notifications_fetcher')
-rw-r--r--src/services/notifications_fetcher/notifications_fetcher.service.js2
1 files changed, 1 insertions, 1 deletions
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 })
}