Skip to content

Commit 0913335

Browse files
authored
Merge pull request #31444 from software-mansion-labs/ts-migration/push-notification
[TS migration] Migrate 'PushNotification.js' lib to TypeScript
2 parents cdb47b7 + 6316a02 commit 0913335

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/libs/actions/PushNotification.js src/libs/actions/PushNotification.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@ import * as Device from './Device';
66
let isUserOptedInToPushNotifications = false;
77
Onyx.connect({
88
key: ONYXKEYS.PUSH_NOTIFICATIONS_ENABLED,
9-
callback: (val) => (isUserOptedInToPushNotifications = val),
9+
callback: (value) => {
10+
if (value === null) {
11+
return;
12+
}
13+
isUserOptedInToPushNotifications = value;
14+
},
1015
});
1116

1217
/**
1318
* Record that user opted-in or opted-out of push notifications on the current device.
14-
*
15-
* @param {Boolean} isOptingIn
1619
*/
17-
function setPushNotificationOptInStatus(isOptingIn) {
20+
function setPushNotificationOptInStatus(isOptingIn: boolean) {
1821
Device.getDeviceID().then((deviceID) => {
1922
const commandName = isOptingIn ? 'OptInToPushNotifications' : 'OptOutOfPushNotifications';
2023
const optimisticData = [

0 commit comments

Comments
 (0)