Commit 92377bea authored by Shpuld Shpludson's avatar Shpuld Shpludson

Merge branch 'fix-notification-polling' into 'develop'

Fix the notifications polling when all the latest notifications are unread

Closes #896

See merge request !1198
parents 067caacb 5b9d22e2
Pipeline #28835 passed with stages
in 5 minutes and 30 seconds
...@@ -35,7 +35,7 @@ const fetchAndUpdate = ({ store, credentials, older = false }) => { ...@@ -35,7 +35,7 @@ const fetchAndUpdate = ({ store, credentials, older = false }) => {
const notifications = timelineData.data const notifications = timelineData.data
const readNotifsIds = notifications.filter(n => n.seen).map(n => n.id) const readNotifsIds = notifications.filter(n => n.seen).map(n => n.id)
const numUnseenNotifs = notifications.length - readNotifsIds.length const numUnseenNotifs = notifications.length - readNotifsIds.length
if (numUnseenNotifs > 0) { if (numUnseenNotifs > 0 && readNotifsIds.length > 0) {
args['since'] = Math.max(...readNotifsIds) args['since'] = Math.max(...readNotifsIds)
fetchNotifications({ store, args, older }) fetchNotifications({ store, args, older })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment