Skip to content

Commit 46ba1ed

Browse files
committed
update dependencies
puppeteer 21.5+ does not work on old hw
1 parent a8faa29 commit 46ba1ed

File tree

4 files changed

+20
-29
lines changed

4 files changed

+20
-29
lines changed

app.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,6 @@ app.whenReady().then(() => {
9898
});
9999
});
100100

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-
110101
ipcMain.on('showMessage', (e, args) => {
111102
let btns = [];
112103

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@
5656
},
5757
"keywords": [],
5858
"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"
6161
},
6262
"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",
6666
"clipboardy": "2.3.0",
6767
"fessonia": "^2.2.2",
68-
"iso8601-duration": "^2.1.1",
68+
"iso8601-duration": "^2.1.2",
6969
"keytar": "^7.9.0",
70-
"puppeteer": "21.1.1"
70+
"puppeteer": "21.4.1"
7171
}
7272
}

preload.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ const SharedownAPI = (() => {
8787
genID: null,
8888
openLink: null,
8989
quitApp: null,
90+
flushAndCloseLogs: null,
9091
getWindowTitle: null
9192
};
9293

@@ -1346,21 +1347,19 @@ const SharedownAPI = (() => {
13461347
});
13471348
}
13481349

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;
13541353

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}`);
13621361
}
1363-
});
1362+
}
13641363

13651364
Object.freeze(api);
13661365
return api;

sharedown/sharedown.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,7 @@ window.addEventListener('DownloadSuccess', () => {
723723
});
724724

725725
window.addEventListener('beforeunload', () => {
726+
sharedownApi.flushAndCloseLogs();
726727
sharedownApi.deleteUserdataFold();
727728
});
728729

0 commit comments

Comments
 (0)