Skip to content
Snippets Groups Projects
Commit b275494a authored by Shpuld Shpludson's avatar Shpuld Shpludson
Browse files

Merge branch 'fix/fetch-seen-notifs-properly' into 'develop'

Fix #526: Oldest notifications left unseen when using "Read!" in another tab

Closes #526

See merge request pleroma/pleroma-fe!1040
parents 7257189e 910b82e2
No related branches found
No related tags found
No related merge requests found
......@@ -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 })
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment