Browse Source

Replaced makeSingleInstance method, deprecated

pull/2111/head
mxb 6 years ago
parent
commit
380dff555f
  1. 11
      electron/main.js

11
electron/main.js

@ -312,7 +312,12 @@ ipcMain.on('relaunchApp', function(event) {
app.exit(0); app.exit(0);
}); });
const shouldQuit = app.makeSingleInstance((commandLine, workingDirectory) => { const shouldQuit = app.requestSingleInstanceLock()
if (!shouldQuit) {
app.quit();
return;
}
app.on('second-instance', (event, commandLine, workingDirectory) => {
// Someone tried to run a second instance, we should focus our window. // Someone tried to run a second instance, we should focus our window.
if (mainWindow) { if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore(); if (mainWindow.isMinimized()) mainWindow.restore();
@ -323,10 +328,6 @@ const shouldQuit = app.makeSingleInstance((commandLine, workingDirectory) => {
} }
}); });
if (shouldQuit) {
app.quit();
return;
}
// Code for downloading images as temporal files // Code for downloading images as temporal files
// Credit: Ghetto Skype (https://github.com/stanfieldr/ghetto-skype) // Credit: Ghetto Skype (https://github.com/stanfieldr/ghetto-skype)

Loading…
Cancel
Save