|
|
|
@ -312,7 +312,12 @@ ipcMain.on('relaunchApp', function(event) {
|
|
|
|
|
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.
|
|
|
|
|
if (mainWindow) { |
|
|
|
|
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
|
|
|
|
|
// Credit: Ghetto Skype (https://github.com/stanfieldr/ghetto-skype)
|
|
|
|
|