From 08008bb25c576dfad9df006b7b5012860d19e45c Mon Sep 17 00:00:00 2001 From: Borewit Date: Sun, 21 Jul 2019 10:19:36 +0200 Subject: [PATCH] #1590 Improve single-instance start-up logic, remove duplicate code. --- src/main/index.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index 9014e0f6..2b14fa83 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -34,12 +34,6 @@ if (process.platform === 'win32') { const squirrelWin32 = require('./squirrel-win32') shouldQuit = squirrelWin32.handleEvent(argv[0]) argv = argv.filter((arg) => !arg.includes('--squirrel')) - - if (shouldQuit) { - app.quit() - } else { - app.on('second-instance', (event, commandLine) => onAppOpen(commandLine)) - } } if (!shouldQuit && !config.IS_PORTABLE) { @@ -55,14 +49,11 @@ if (!shouldQuit && !config.IS_PORTABLE) { if (shouldQuit) { app.quit() } else { - app.on('second-instance', (event, commandLine, workingDirectory) => onAppOpen(commandLine)) -} - -if (!shouldQuit) { init() } function init () { + app.on('second-instance', (event, commandLine, workingDirectory) => onAppOpen(commandLine)) if (config.IS_PORTABLE) { const path = require('path') // Put all user data into the "Portable Settings" folder