@@ -33,6 +33,7 @@ import {
3333 DEFAULT_APP_SETTINGS ,
3434 DEFAULT_WINDOW_OPTIONS ,
3535} from './config' ;
36+ import { asarPath } from './helpers/asar-helpers' ;
3637/* eslint-enable import/first */
3738
3839const debug = require ( 'debug' ) ( 'Franz:App' ) ;
@@ -88,6 +89,12 @@ if (!gotTheLock) {
8889 window . setPosition ( DEFAULT_WINDOW_OPTIONS . x + 100 , DEFAULT_WINDOW_OPTIONS . y + 100 ) ;
8990 window . setSize ( DEFAULT_WINDOW_OPTIONS . width , DEFAULT_WINDOW_OPTIONS . height ) ;
9091 } , 1 ) ;
92+ } else if ( argv . includes ( '--quit' ) ) {
93+ // Needs to be delayed to not interfere with mainWindow.restore();
94+ setTimeout ( ( ) => {
95+ debug ( 'Quitting Franz via Task' ) ;
96+ app . quit ( ) ;
97+ } , 1 ) ;
9198 }
9299 } ) ;
93100 }
@@ -294,10 +301,15 @@ app.on('ready', () => {
294301 app . setUserTasks ( [ {
295302 program : process . execPath ,
296303 arguments : `${ isDevMode ? `${ __dirname } ` : '' } --reset-window` ,
297- iconPath : path . join ( `${ __dirname } ` , ' ../src/assets/images/taskbar/win32/display.ico') ,
304+ iconPath : asarPath ( path . join ( isDevMode ? `${ __dirname } ../src/` : __dirname , ' assets/images/taskbar/win32/display.ico') ) ,
298305 iconIndex : 0 ,
299306 title : 'Move Franz to Current Display' ,
300307 description : 'Restore the position and size of Franz' ,
308+ } , {
309+ program : process . execPath ,
310+ arguments : `${ isDevMode ? `${ __dirname } ` : '' } --quit` ,
311+ iconIndex : 0 ,
312+ title : 'Quit Franz' ,
301313 } ] ) ;
302314 }
303315
0 commit comments