Opening the app on click of the laucher icon when no window is visible

This commit is contained in:
Manoj Vivek 2019-09-04 13:24:03 +05:30
parent 68550864f8
commit 309444e7a5

View file

@ -74,7 +74,7 @@ app.on('login', (event, webContents, request, authInfo, callback) => {
mainWindow.webContents.send('http-auth-prompt', {url});
});
app.on('ready', async () => {
const createWindow = async () => {
if (
process.env.NODE_ENV === 'development' ||
process.env.DEBUG_PROD === 'true'
@ -140,4 +140,13 @@ app.on('ready', async () => {
// Remove this if your app does not use auto updates
// eslint-disable-next-line
new AppUpdater();
};
app.on('activate', (event, hasVisibleWindows) => {
if (hasVisibleWindows) {
return;
}
createWindow();
});
app.on('ready', createWindow);