@@ -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 }
@@ -265,10 +272,15 @@ app.on('ready', () => {
265272 app . setUserTasks ( [ {
266273 program : process . execPath ,
267274 arguments : `${ isDevMode ? `${ __dirname } ` : '' } --reset-window` ,
268- iconPath : path . join ( `${ __dirname } ` , ' ../src/assets/images/taskbar/win32/display.ico') ,
275+ iconPath : asarPath ( path . join ( isDevMode ? `${ __dirname } ../src/` : __dirname , ' assets/images/taskbar/win32/display.ico') ) ,
269276 iconIndex : 0 ,
270277 title : 'Move Franz to Current Display' ,
271278 description : 'Restore the position and size of Franz' ,
279+ } , {
280+ program : process . execPath ,
281+ arguments : `${ isDevMode ? `${ __dirname } ` : '' } --quit` ,
282+ iconIndex : 0 ,
283+ title : 'Quit Franz' ,
272284 } ] ) ;
273285 }
274286
0 commit comments