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-04-24 19:41:27 -0500
committerGitHub <noreply@github.com>2023-04-24 19:41:27 -0500
commitf4da2f444281c8b8f693833d727fc7c7bc85f8ae (patch)
treebe4b25dc98f170d6b3d3faec326240e8e8574b71 /src/view/screens/Notifications.tsx
parent7a1076271600814629d52b8a1d6eb02b968c947f (diff)
downloadvoidsky-f4da2f444281c8b8f693833d727fc7c7bc85f8ae.tar.zst
Tune feed loading behavior (#528)
* Never autoload home feed on focus

* On web, just check for new notifications on focus

* Switching tab in the home feed now checks for latest
Diffstat (limited to 'src/view/screens/Notifications.tsx')
-rw-r--r--src/view/screens/Notifications.tsx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/view/screens/Notifications.tsx b/src/view/screens/Notifications.tsx
index d93666aa8..8d6f7c83a 100644
--- a/src/view/screens/Notifications.tsx
+++ b/src/view/screens/Notifications.tsx
@@ -16,6 +16,7 @@ import {useOnMainScroll} from 'lib/hooks/useOnMainScroll'
 import {useTabFocusEffect} from 'lib/hooks/useTabFocusEffect'
 import {s} from 'lib/styles'
 import {useAnalytics} from 'lib/analytics'
+import {isWeb} from 'platform/detection'
 
 type Props = NativeStackScreenProps<
   NotificationsTabNavigatorParams,
@@ -70,10 +71,14 @@ export const NotificationsScreen = withAuthRequired(
           // essentially equivalent to useFocusEffect because we dont used tabbed
           // navigation
           if (isInside) {
-            if (store.me.notifications.unreadCount > 0) {
-              store.me.notifications.refresh()
-            } else {
+            if (isWeb) {
               store.me.notifications.syncQueue()
+            } else {
+              if (store.me.notifications.unreadCount > 0) {
+                store.me.notifications.refresh()
+              } else {
+                store.me.notifications.syncQueue()
+              }
             }
           }
         },