about summary refs log tree commit diff
path: root/src/view/screens/Notifications.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-12-13 12:16:55 -0800
committerGitHub <noreply@github.com>2023-12-13 12:16:55 -0800
commite3ba014be00f545b3dbd39b5dcfc198a69c790d4 (patch)
tree323937c93516efe82dc6f30b748a3d5c4a8333ea /src/view/screens/Notifications.tsx
parenteecf04489f0c580a259a7977271bb35abcf4dbee (diff)
downloadvoidsky-e3ba014be00f545b3dbd39b5dcfc198a69c790d4.tar.zst
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
Diffstat (limited to 'src/view/screens/Notifications.tsx')
-rw-r--r--src/view/screens/Notifications.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/view/screens/Notifications.tsx b/src/view/screens/Notifications.tsx
index fceaa60c2..7ebacc9db 100644
--- a/src/view/screens/Notifications.tsx
+++ b/src/view/screens/Notifications.tsx
@@ -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