Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
killActor(silent) {
if (!silent) {
// console.log('timer is on');
// console.log('screen will dim');
// console.log('setting idle timer disabled to false, notifications.ios.js line 43');
IdleTimerManager.setIdleTimerDisabled(false);
}
if (this.timerType) {
switch (this.timerType) {
case TIMER_TYPE_TIMEOUT: {
clearTimeout(this.timerID);
break;
}
case TIMER_TYPE_INTERVAL: {
clearInterval(this.timerID);
break;
}
default: {
break;
SilentSwitch.addEventListener((silent) => {
this.silent = silent;
if (AppState.currentState === 'active') {
if (silent || this.permissions !== NOTIFICATION_PERMISSIONS_STATUS_AUTHORIZED) {
// console.log('timer is off')
// console.log('screen will not dim')
// console.log('setting idle timer disabled to true, notifications.ios.js line 49');
IdleTimerManager.setIdleTimerDisabled(true);
} else {
// console.log('timer is on');
// console.log('screen will dim');
// console.log('setting idle timer disabled to false, notifications.ios.js line 43');
IdleTimerManager.setIdleTimerDisabled(false);
}
this.dispatch(updateSilentSwitchState(silent));
}
});
SilentSwitch.addEventListener((silent) => {
this.silent = silent;
if (AppState.currentState === 'active') {
if (silent || this.permissions !== NOTIFICATION_PERMISSIONS_STATUS_AUTHORIZED) {
// console.log('timer is off')
// console.log('screen will not dim')
// console.log('setting idle timer disabled to true, notifications.ios.js line 49');
IdleTimerManager.setIdleTimerDisabled(true);
} else {
// console.log('timer is on');
// console.log('screen will dim');
// console.log('setting idle timer disabled to false, notifications.ios.js line 43');
IdleTimerManager.setIdleTimerDisabled(false);
}
this.dispatch(updateSilentSwitchState(silent));
}
});
constructor(store) {
this.dispatch = store.dispatch;
this.timerID = null;
this.timerType = null;
// console.log('timer is off')
// console.log('screen will not dim')
// console.log('setting idle timer disabled to true, notifications.ios.js line 49');
IdleTimerManager.setIdleTimerDisabled(true);
this.watchTime();
}