Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(async () => {
switch (command) {
case 'on':
await doNotDisturb.enable();
break;
case 'off':
await doNotDisturb.disable();
break;
case 'toggle':
await doNotDisturb.toggle();
break;
case 'status':
console.log(await doNotDisturb.isEnabled() ? 'on' : 'off');
break;
default:
cli.showHelp();
}
})();
const cleanup = () => {
const {
hideDesktopIcons,
doNotDisturb
} = lastUsedSettings;
closeAllCroppers();
resetTray();
if (hideDesktopIcons) {
desktopIcons.show();
}
if (doNotDisturb && !wasDoNotDisturbAlreadyEnabled) {
dnd.disable();
}
setCropperShortcutAction();
};
const stopRecording = async () => {
ipcRenderer.send('will-stop-recording');
const filePath = await aperture.stopRecording();
if (app.kap.settings.get('hideDesktopIcons')) {
desktopIcons.show();
}
if (app.kap.settings.get('doNotDisturb') && !wasDoNotDisturbAlreadyEnabled) {
doNotDisturb.disable();
}
ipcRenderer.send('stopped-recording');
ipcRenderer.send('open-editor-window', {filePath});
setMainWindowSize();
};