1
0
mirror of https://git.pleroma.social/sjw/pleroma-fe.git synced 2024-12-23 15:05:04 +01:00

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

Fix the notifications polling when all the latest notifications are unread

Closes #896

See merge request pleroma/pleroma-fe!1198
This commit is contained in:
Shpuld Shpludson 2020-07-20 08:22:51 +00:00
commit 92377beab1

View File

@ -35,7 +35,7 @@ const fetchAndUpdate = ({ store, credentials, older = false }) => {
const notifications = timelineData.data
const readNotifsIds = notifications.filter(n => n.seen).map(n => n.id)
const numUnseenNotifs = notifications.length - readNotifsIds.length
if (numUnseenNotifs > 0) {
if (numUnseenNotifs > 0 && readNotifsIds.length > 0) {
args['since'] = Math.max(...readNotifsIds)
fetchNotifications({ store, args, older })
}