Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
delegateToLauncher(argv).then(hasLauncherInvoked => {
if (hasLauncherInvoked) {
app.quit();
return;
}
appReady = true;
app.commandLine.appendSwitch('scroll-bounce');
tryCreateWindow();
// if in development install the react devtools extension
if (process.env.NODE_ENV === 'development') {
const {
default: installExtension,
REACT_DEVELOPER_TOOLS,
REDUX_DEVTOOLS,
} = require('electron-devtools-installer');
installExtension(REACT_DEVELOPER_TOOLS.id);
installExtension(REDUX_DEVTOOLS.id);
}
});
});
const {default: installExtension, REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS} = require('electron-devtools-installer')
try {
await installExtension(REACT_DEVELOPER_TOOLS)
} catch (error) {
console.error(error)
}
try {
await installExtension(REDUX_DEVTOOLS)
} catch (error) {
console.error(error)
}
} else {
const path = require('path')
const udata = app.getPath('userData')
const {REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS} = require('electron-devtools-installer')
BrowserWindow.addDevToolsExtension(path.join(udata, 'extensions', REACT_DEVELOPER_TOOLS.id))
BrowserWindow.addDevToolsExtension(path.join(udata, 'extensions', REDUX_DEVTOOLS.id))
}
}