diff options
-rw-r--r-- | src/lib/hooks/useNotificationHandler.ts | 2 | ||||
-rw-r--r-- | src/lib/notifications/notifications.ts | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/hooks/useNotificationHandler.ts b/src/lib/hooks/useNotificationHandler.ts index e288ac3ad..3f1cd439d 100644 --- a/src/lib/hooks/useNotificationHandler.ts +++ b/src/lib/hooks/useNotificationHandler.ts @@ -41,7 +41,7 @@ type NotificationPayload = } const DEFAULT_HANDLER_OPTIONS = { - shouldShowAlert: true, + shouldShowAlert: false, shouldPlaySound: false, shouldSetBadge: true, } diff --git a/src/lib/notifications/notifications.ts b/src/lib/notifications/notifications.ts index 1182bfcbb..6f28608f4 100644 --- a/src/lib/notifications/notifications.ts +++ b/src/lib/notifications/notifications.ts @@ -71,12 +71,14 @@ export function useNotificationsRegistration() { export function useRequestNotificationsPermission() { const gate = useGate() + const {currentAccount} = useSession() return React.useCallback( async (context: 'StartOnboarding' | 'AfterOnboarding' | 'Login') => { const permissions = await Notifications.getPermissionsAsync() if ( + !currentAccount || !isNative || permissions?.status === 'granted' || (permissions?.status === 'denied' && !permissions?.canAskAgain) @@ -107,7 +109,7 @@ export function useRequestNotificationsPermission() { getPushToken(true) } }, - [gate], + [gate, currentAccount], ) } |