Fix notification mark-read behaviors (#2696)
* Mark read on first notifs page fetch always; this is less optimal but it fixes a case where when the first full page's unreads are all filtered out * Use the pre-filter indexedAt for updateSeen
This commit is contained in:
parent
a175922ccf
commit
45291f17a0
3 changed files with 25 additions and 17 deletions
|
|
@ -67,18 +67,20 @@ export function useNotificationFeedQuery(opts?: {enabled?: boolean}) {
|
|||
page = unreads.getCachedUnreadPage()
|
||||
}
|
||||
if (!page) {
|
||||
page = await fetchPage({
|
||||
limit: PAGE_SIZE,
|
||||
cursor: pageParam,
|
||||
queryClient,
|
||||
moderationOpts,
|
||||
threadMutes,
|
||||
fetchAdditionalData: true,
|
||||
})
|
||||
page = (
|
||||
await fetchPage({
|
||||
limit: PAGE_SIZE,
|
||||
cursor: pageParam,
|
||||
queryClient,
|
||||
moderationOpts,
|
||||
threadMutes,
|
||||
fetchAdditionalData: true,
|
||||
})
|
||||
).page
|
||||
}
|
||||
|
||||
// if the first page has an unread, mark all read
|
||||
if (!pageParam && page.items[0] && !page.items[0].notification.isRead) {
|
||||
if (!pageParam) {
|
||||
unreads.markAllRead()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue