From 2f7d890ad228a2aeb8643373c9c9a6d925c6ff7f Mon Sep 17 00:00:00 2001 From: dave Date: Wed, 13 Mar 2019 14:08:03 -0400 Subject: #436: add dismiss button, disable is_seen part --- .../notifications_fetcher.service.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/services/notifications_fetcher/notifications_fetcher.service.js') 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' -- cgit v1.2.3-70-g09d2