File tree 4 files changed +20
-29
lines changed 4 files changed +20
-29
lines changed Original file line number Diff line number Diff line change @@ -98,15 +98,6 @@ app.whenReady().then(() => {
98
98
} ) ;
99
99
} ) ;
100
100
101
- app . on ( 'window-all-closed' , ( ) => {
102
- if ( ! isDarwin )
103
- app . quit ( ) ;
104
- } ) ;
105
-
106
- app . on ( 'before-quit' , ( ) => {
107
- mainW . webContents . send ( 'appevent' , { cmd : 'bfq' } ) ;
108
- } ) ;
109
-
110
101
ipcMain . on ( 'showMessage' , ( e , args ) => {
111
102
let btns = [ ] ;
112
103
Original file line number Diff line number Diff line change 56
56
},
57
57
"keywords" : [],
58
58
"devDependencies" : {
59
- "electron" : " ^26 .2.0" ,
60
- "electron-builder" : " ^24.6.4 "
59
+ "electron" : " ^29 .2.0" ,
60
+ "electron-builder" : " ^25.0.0-alpha.6 "
61
61
},
62
62
"dependencies" : {
63
- "@fortawesome/fontawesome-free" : " 6.4 .2" ,
64
- "axios" : " ^1.5.0 " ,
65
- "bootstrap" : " 5.3.1 " ,
63
+ "@fortawesome/fontawesome-free" : " 6.5 .2" ,
64
+ "axios" : " ^1.6.8 " ,
65
+ "bootstrap" : " 5.3.3 " ,
66
66
"clipboardy" : " 2.3.0" ,
67
67
"fessonia" : " ^2.2.2" ,
68
- "iso8601-duration" : " ^2.1.1 " ,
68
+ "iso8601-duration" : " ^2.1.2 " ,
69
69
"keytar" : " ^7.9.0" ,
70
- "puppeteer" : " 21.1 .1"
70
+ "puppeteer" : " 21.4 .1"
71
71
}
72
72
}
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ const SharedownAPI = (() => {
87
87
genID : null ,
88
88
openLink : null ,
89
89
quitApp : null ,
90
+ flushAndCloseLogs : null ,
90
91
getWindowTitle : null
91
92
} ;
92
93
@@ -1346,21 +1347,19 @@ const SharedownAPI = (() => {
1346
1347
} ) ;
1347
1348
}
1348
1349
1349
- ipcRenderer . on ( 'appevent' , ( e , args ) => {
1350
- switch ( args . cmd ) {
1351
- case 'bfq' : {
1352
- if ( ! _enableLogs )
1353
- break ;
1350
+ api . flushAndCloseLogs = ( ) => {
1351
+ if ( ! _enableLogs )
1352
+ return ;
1354
1353
1355
- _fs . fsyncSync ( _shLogFd ) ;
1356
- _fs . fsyncSync ( _ytdlpLogFd ) ;
1357
- api . disableLogs ( ) ;
1358
- }
1359
- break ;
1360
- default :
1361
- break ;
1354
+ try {
1355
+ _fs . fsyncSync ( _shLogFd ) ;
1356
+ _fs . fsyncSync ( _ytdlpLogFd ) ;
1357
+ api . disableLogs ( ) ;
1358
+
1359
+ } catch ( e ) {
1360
+ console . log ( `failed to flushAndCloseLogs, ${ e ?. message } ` ) ;
1362
1361
}
1363
- } ) ;
1362
+ }
1364
1363
1365
1364
Object . freeze ( api ) ;
1366
1365
return api ;
Original file line number Diff line number Diff line change @@ -723,6 +723,7 @@ window.addEventListener('DownloadSuccess', () => {
723
723
} ) ;
724
724
725
725
window . addEventListener ( 'beforeunload' , ( ) => {
726
+ sharedownApi . flushAndCloseLogs ( ) ;
726
727
sharedownApi . deleteUserdataFold ( ) ;
727
728
} ) ;
728
729
You can’t perform that action at this time.
0 commit comments