File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ app.on('ready', function() {
5959
6060// Quit when all windows are closed.
6161app . on ( 'window-all-closed' , ( ) => {
62- app . quit ( ) ;
62+ app . exit ( ) ;
6363} ) ;
6464
6565app . on ( 'activate' , ( ) => {
@@ -87,20 +87,24 @@ var shouldQuit = app.makeSingleInstance((argv, workingDirectory) => {
8787 // Another instance was launched. If it was launched with a URL, it should be in the second param.
8888 if ( argv && argv [ 1 ] ) {
8989 appLaunched ( argv [ 1 ] ) ;
90+ } else {
91+ focusApp ( ) ;
9092 }
9193} ) ;
9294
93- if ( shouldQuit ) {
95+ // For some reason, shouldQuit is always true in signed Mac apps so we should ingore it.
96+ if ( shouldQuit && os . platform ( ) . indexOf ( 'darwin' ) == - 1 ) {
9497 // It's not the main instance of the app, kill it.
95- app . quit ( ) ;
96- } else {
97- // Listen for open-url events (Mac OS only).
98- app . on ( 'open-url' , ( event , url ) => {
99- event . preventDefault ( ) ;
100- appLaunched ( url ) ;
101- } ) ;
98+ app . exit ( ) ;
99+ return ;
102100}
103101
102+ // Listen for open-url events (Mac OS only).
103+ app . on ( 'open-url' , ( event , url ) => {
104+ event . preventDefault ( ) ;
105+ appLaunched ( url ) ;
106+ } ) ;
107+
104108function appLaunched ( url ) {
105109 // App was launched again with a URL. Focus the main window and send an event to treat the URL.
106110 if ( mainWindow ) {
You can’t perform that action at this time.
0 commit comments