diff options
Diffstat (limited to 'src/services/notifications_fetcher/notifications_fetcher.service.js')
| -rw-r--r-- | src/services/notifications_fetcher/notifications_fetcher.service.js | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/services/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js index 3ecdae6a..9eac5ab4 100644 --- a/src/services/notifications_fetcher/notifications_fetcher.service.js +++ b/src/services/notifications_fetcher/notifications_fetcher.service.js @@ -16,17 +16,21 @@ const fetchAndUpdate = ({store, credentials, older = false}) => { args['until'] = timelineData.minId } } else { - // load unread notifications repeadedly to provide consistency between browser tabs - const notifications = timelineData.data - const unread = notifications.filter(n => !n.seen).map(n => n.id) - if (!unread.length) { + if (timelineData.maxId !== Number.POSITIVE_INFINITY) { args['since'] = timelineData.maxId - } else { - args['since'] = Math.min(...unread) - 1 - if (timelineData.maxId !== Math.max(...unread)) { - args['until'] = Math.max(...unread, args['since'] + 20) - } } + // # disabled until is_seen is impelented on the BE + // load unread notifications repeadedly to provide consistency between browser tabs + // const notifications = timelineData.data + // const unread = notifications.filter(n => !n.seen).map(n => n.id) + // if (!unread.length) { + // args['since'] = timelineData.maxId + // } else { + // args['since'] = Math.min(...unread) - 1 + // if (timelineData.maxId !== Math.max(...unread)) { + // args['until'] = Math.max(...unread, args['since'] + 20) + // } + // } } args['timeline'] = 'notifications' |
