File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -6,15 +6,18 @@ import * as Device from './Device';
6
6
let isUserOptedInToPushNotifications = false ;
7
7
Onyx . connect ( {
8
8
key : ONYXKEYS . PUSH_NOTIFICATIONS_ENABLED ,
9
- callback : ( val ) => ( isUserOptedInToPushNotifications = val ) ,
9
+ callback : ( value ) => {
10
+ if ( value === null ) {
11
+ return ;
12
+ }
13
+ isUserOptedInToPushNotifications = value ;
14
+ } ,
10
15
} ) ;
11
16
12
17
/**
13
18
* Record that user opted-in or opted-out of push notifications on the current device.
14
- *
15
- * @param {Boolean } isOptingIn
16
19
*/
17
- function setPushNotificationOptInStatus ( isOptingIn ) {
20
+ function setPushNotificationOptInStatus ( isOptingIn : boolean ) {
18
21
Device . getDeviceID ( ) . then ( ( deviceID ) => {
19
22
const commandName = isOptingIn ? 'OptInToPushNotifications' : 'OptOutOfPushNotifications' ;
20
23
const optimisticData = [
You can’t perform that action at this time.
0 commit comments