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:
parent
eecf04489f
commit
e3ba014be0
6 changed files with 42 additions and 29 deletions
|
@ -67,8 +67,8 @@ export function NotificationsScreen({}: Props) {
|
|||
const onFocusCheckLatest = React.useCallback(() => {
|
||||
// on focus, check for latest, but only invalidate if the user
|
||||
// isnt scrolled down to avoid moving content underneath them
|
||||
unreadApi.checkUnread({invalidate: !isScrolledDown})
|
||||
}, [unreadApi, isScrolledDown])
|
||||
unreadApi.checkUnread({invalidate: !isScrolledDown && isDesktop})
|
||||
}, [unreadApi, isScrolledDown, isDesktop])
|
||||
checkLatestRef.current = onFocusCheckLatest
|
||||
|
||||
// on-visible setup
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue