remove unnecessary fetchAndUpdate, change notifications fetcher to not double fetch
This commit is contained in:
parent
82944f862d
commit
62d0bc47b3
4 changed files with 5 additions and 14 deletions
|
@ -31,8 +31,11 @@ const fetchAndUpdate = ({ store, credentials, older = false }) => {
|
|||
const notifications = timelineData.data
|
||||
const readNotifsIds = notifications.filter(n => n.seen).map(n => n.id)
|
||||
if (readNotifsIds.length) {
|
||||
args['since'] = Math.max(...readNotifsIds)
|
||||
fetchNotifications({ store, args, older })
|
||||
const possibleMax = Math.max(...readNotifsIds)
|
||||
if (possibleMax !== timelineData.maxId) {
|
||||
args['since'] = possibleMax
|
||||
fetchNotifications({ store, args, older })
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue