aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShpuld Shpuldson <shpuld@shpposter.club>2020-01-14 13:39:17 +0200
committerShpuld Shpuldson <shpuld@shpposter.club>2020-01-14 13:39:17 +0200
commitdd740043c658f312b6331a6b715592c9d50c50e7 (patch)
tree2a8ca5e6be41c351cad4cd02e3f5d9e3fd4074f9 /src
parent9b8cdb652518e55cd126d70d3902a0953979c145 (diff)
parentb275494a86571e68ac8276c27cb88d2859570779 (diff)
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma-fe into develop
Diffstat (limited to 'src')
-rw-r--r--src/services/notifications_fetcher/notifications_fetcher.service.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/services/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js
index 47008026..64499a1b 100644
--- a/src/services/notifications_fetcher/notifications_fetcher.service.js
+++ b/src/services/notifications_fetcher/notifications_fetcher.service.js
@@ -2,7 +2,6 @@ import apiService from '../api/api.service.js'
const update = ({ store, notifications, older }) => {
store.dispatch('setNotificationsError', { value: false })
-
store.dispatch('addNewNotifications', { notifications, older })
}
@@ -30,9 +29,9 @@ const fetchAndUpdate = ({ store, credentials, older = false }) => {
// load unread notifications repeatedly 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'] = Math.min(...unread)
+ const readNotifsIds = notifications.filter(n => n.seen).map(n => n.id)
+ if (readNotifsIds.length) {
+ args['since'] = Math.max(...readNotifsIds)
fetchNotifications({ store, args, older })
}