about summary refs log tree commit diff
path: root/src/lib/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/hooks')
-rw-r--r--src/lib/hooks/useDraggableScrollView.ts8
-rw-r--r--src/lib/hooks/useNotificationHandler.ts13
2 files changed, 12 insertions, 9 deletions
diff --git a/src/lib/hooks/useDraggableScrollView.ts b/src/lib/hooks/useDraggableScrollView.ts
index 3471d0d06..05fda9a9f 100644
--- a/src/lib/hooks/useDraggableScrollView.ts
+++ b/src/lib/hooks/useDraggableScrollView.ts
@@ -1,6 +1,6 @@
-import {ForwardedRef, useEffect, useMemo, useRef} from 'react'
-import type {ScrollView} from 'react-native'
-import {findNodeHandle, Platform} from 'react-native'
+import {type ForwardedRef, useEffect, useMemo, useRef} from 'react'
+import {type ScrollView} from 'react-native'
+import {Platform} from 'react-native'
 
 import {mergeRefs} from '#/lib/merge-refs'
 
@@ -19,7 +19,7 @@ export function useDraggableScroll<Scrollable extends ScrollView = ScrollView>({
     if (Platform.OS !== 'web' || !ref.current) {
       return
     }
-    const slider = findNodeHandle(ref.current) as unknown as HTMLDivElement
+    const slider = ref.current as unknown as HTMLDivElement
     if (!slider) {
       return
     }
diff --git a/src/lib/hooks/useNotificationHandler.ts b/src/lib/hooks/useNotificationHandler.ts
index b5566f8a6..9c9522aa5 100644
--- a/src/lib/hooks/useNotificationHandler.ts
+++ b/src/lib/hooks/useNotificationHandler.ts
@@ -4,7 +4,7 @@ import {CommonActions, useNavigation} from '@react-navigation/native'
 import {useQueryClient} from '@tanstack/react-query'
 
 import {useAccountSwitcher} from '#/lib/hooks/useAccountSwitcher'
-import {NavigationProp} from '#/lib/routes/types'
+import {type NavigationProp} from '#/lib/routes/types'
 import {logEvent} from '#/lib/statsig/statsig'
 import {Logger} from '#/logger'
 import {isAndroid} from '#/platform/detection'
@@ -41,10 +41,11 @@ type NotificationPayload =
     }
 
 const DEFAULT_HANDLER_OPTIONS = {
-  shouldShowAlert: false,
+  shouldShowBanner: false,
+  shouldShowList: false,
   shouldPlaySound: false,
   shouldSetBadge: true,
-}
+} satisfies Notifications.NotificationBehavior
 
 // These need to stay outside the hook to persist between account switches
 let storedPayload: NotificationPayload | undefined
@@ -195,11 +196,13 @@ export function useNotificationsHandler() {
           payload.reason === 'chat-message' &&
           payload.recipientDid === currentAccount?.did
         ) {
+          const shouldAlert = payload.convoId !== currentConvoId
           return {
-            shouldShowAlert: payload.convoId !== currentConvoId,
+            shouldShowList: shouldAlert,
+            shouldShowBanner: shouldAlert,
             shouldPlaySound: false,
             shouldSetBadge: false,
-          }
+          } satisfies Notifications.NotificationBehavior
         }
 
         // Any notification other than a chat message should invalidate the unread page