File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ const cleanup = () => {
1616
1717export const getReadyToQuitApp = async ( ) => {
1818 return new Promise ( ( resolve ) => {
19+ global . isQuitting = true ;
1920 cleanup ( ) ;
2021
2122 if ( global . backgroundWindow ) {
Original file line number Diff line number Diff line change @@ -68,6 +68,14 @@ const startBackgroundProcess = async () => {
6868 backgroundWindow . webContents . openDevTools ( ) ;
6969 } )
7070 }
71+
72+ backgroundWindow . on ( 'close' , ( event ) => {
73+ if ( ! global . isQuitting ) {
74+ event . preventDefault ( ) ;
75+ backgroundWindow . hide ( ) ;
76+ }
77+ return false ;
78+ } ) ;
7179
7280 // Setup IPC forwarding
7381 setupIPCForwardingToBackground ( backgroundWindow ) ;
Original file line number Diff line number Diff line change @@ -335,7 +335,7 @@ const createWindow = async () => {
335335 globalAny . backgroundWindow . show ( ) ;
336336
337337 // eslint-disable-next-line
338- globalAny . backgroundWindow . webContents . toggleDevTools ( ) ;
338+ globalAny . backgroundWindow . webContents . openDevTools ( ) ;
339339 }
340340 } catch ( error ) {
341341 console . error ( error ) ;
You can’t perform that action at this time.
0 commit comments