More notifications improvements (#2198)

* On mobile, never replace the notifs under the user due to focus events

* Use the server's seenAt response to calculate isRead state locally
This commit is contained in:
Paul Frazee 2023-12-13 12:16:55 -08:00 committed by GitHub
parent eecf04489f
commit e3ba014be0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 42 additions and 29 deletions

View file

@ -68,8 +68,14 @@ export async function fetchPage({
notif => !isThreadMuted(notif, threadMutes),
)
let seenAt = res.data.seenAt ? new Date(res.data.seenAt) : new Date()
if (Number.isNaN(seenAt.getTime())) {
seenAt = new Date()
}
return {
cursor: res.data.cursor,
seenAt,
items: notifsGrouped,
}
}