about summary refs log tree commit diff
path: root/src/view/screens/Notifications.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/screens/Notifications.tsx')
-rw-r--r--src/view/screens/Notifications.tsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/view/screens/Notifications.tsx b/src/view/screens/Notifications.tsx
index e28a67e37..6e2f18305 100644
--- a/src/view/screens/Notifications.tsx
+++ b/src/view/screens/Notifications.tsx
@@ -1,6 +1,6 @@
 import React from 'react'
 import {View} from 'react-native'
-import {useFocusEffect} from '@react-navigation/native'
+import {useFocusEffect, useIsFocused} from '@react-navigation/native'
 import {useQueryClient} from '@tanstack/react-query'
 import {
   NativeStackScreenProps,
@@ -46,6 +46,7 @@ export function NotificationsScreen({}: Props) {
   const unreadNotifs = useUnreadNotifications()
   const unreadApi = useUnreadNotificationsApi()
   const hasNew = !!unreadNotifs
+  const isScreenFocused = useIsFocused()
 
   // event handlers
   // =
@@ -83,8 +84,11 @@ export function NotificationsScreen({}: Props) {
     }, [screen, setMinimalShellMode]),
   )
   React.useEffect(() => {
+    if (!isScreenFocused) {
+      return
+    }
     return listenSoftReset(onPressLoadLatest)
-  }, [onPressLoadLatest])
+  }, [onPressLoadLatest, isScreenFocused])
 
   const ListHeaderComponent = React.useCallback(() => {
     if (isDesktop) {