From b37961bc5868231c26ba67cb99ecb8a93bd8253c Mon Sep 17 00:00:00 2001 From: johnathan White Date: Tue, 2 Aug 2022 16:56:23 -0400 Subject: [PATCH] check for undefined --- src/navigation/tabs/settings/components/Notifications.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/navigation/tabs/settings/components/Notifications.tsx b/src/navigation/tabs/settings/components/Notifications.tsx index 5384e1d96..e9ba9b1bc 100644 --- a/src/navigation/tabs/settings/components/Notifications.tsx +++ b/src/navigation/tabs/settings/components/Notifications.tsx @@ -6,6 +6,7 @@ import { Linking, LogBox, DeviceEventEmitter, + Platform, } from 'react-native'; import {AppEffects} from '../../../../store/app'; import { @@ -53,7 +54,10 @@ const Notifications = () => { async (accepted: boolean, notificationsStatePush?: boolean) => { const systemEnabled = await AppEffects.checkNotificationsPermissions(); if (systemEnabled) { - if (accepted !== notificationsStatePush) { + if ( + notificationsStatePush !== undefined && + accepted !== notificationsStatePush + ) { dispatch(AppEffects.setNotifications(accepted)); dispatch(AppEffects.setConfirmTxNotifications(accepted)); dispatch(AppEffects.setAnnouncementsNotifications(accepted));