Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static async setup() {
// https://github.com/sindresorhus/electron-util#enforcemacosapplocation-macos
enforceMacOSAppLocation()
// application exit.
app.on('will-quit', async (event) => {
logger.debug('Exiting...')
event.preventDefault()
await this.shutdown()
app.exit()
})
// windows closed, no more to do.
app.on('window-all-closed', () => {
app.quit()
})
app.on('ready', () => {
util.enforceMacOSAppLocation();
// Ensure all plugins are up to date
plugins.upgrade().catch(() => {});
if (settings.get('recordKeyboardShortcut')) {
globalShortcut.register('Cmd+Shift+5', () => {
const recording = (appState === 'recording');
mainWindow.webContents.send((recording) ? 'stop-recording' : 'prepare-recording');
});
}
});