Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
toggle: async () => {
await Push.setEnabled(!this.state.pushEnabled);
const pushEnabled = await Push.isEnabled();
this.setState({ pushEnabled });
}
},
async toggleEnabled() {
await Push.setEnabled(!this.state.pushEnabled);
const pushEnabled = await Push.isEnabled();
this.setState({ pushEnabled });
}
async toggleEnabled() {
await Push.setEnabled(!this.state.pushEnabled);
const pushEnabled = await Push.isEnabled();
this.setState({ pushEnabled });
}
Object.keys(notificationDetails).map(item => {
const notificationType = item.replace('Notification', '');
if (notificationType === actionType.replace('notification.', '')) {
if (action) {
notifyTypes.push(notifyTypesConst[notificationType]);
}
} else if (notificationDetails[item]) {
notifyTypes.push(notifyTypesConst[notificationType]);
}
});
notifyTypes.sort();
if (actionType === 'notification') {
await Push.setEnabled(action);
this._setPushToken(action ? notifyTypes : []);
} else {
this._setPushToken(notifyTypes);
}
};
toggle: async () => {
await Push.setEnabled(!this.state.pushEnabled);
const pushEnabled = await Push.isEnabled();
this.setState({ pushEnabled });
}
},
);
this.setState({ isThemeReady: true });
if (settings.isPinCodeOpen !== '') dispatch(isPinCodeOpen(settings.isPinCodeOpen));
if (settings.language !== '') dispatch(setLanguage(settings.language));
if (settings.server !== '') dispatch(setApi(settings.server));
if (settings.upvotePercent !== '') {
dispatch(setUpvotePercent(Number(settings.upvotePercent)));
}
if (settings.isDefaultFooter !== '') dispatch(isDefaultFooter(settings.isDefaultFooter));
if (settings.notification !== '') {
dispatch(
changeNotificationSettings({ type: 'notification', action: settings.notification }),
);
dispatch(changeAllNotificationSettings(settings));
Push.setEnabled(settings.notification);
}
if (settings.nsfw !== '') dispatch(setNsfw(settings.nsfw));
if (settings.currency !== '') {
dispatch(setCurrency(settings.currency !== '' ? settings.currency : 'usd'));
}
}
};
async toggleEnabled() {
await Push.setEnabled(!this.state.pushEnabled);
const pushEnabled = await Push.isEnabled();
this.setState({ pushEnabled });
}