Skip to content

Commit 74b078c

Browse files
authored
Merge pull request #482 from mienaiyami/fix/458
Fix/458
2 parents cedea05 + 3d5cad0 commit 74b078c

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "yomikiru",
33
"productName": "Yomikiru",
4-
"version": "2.23.0",
4+
"version": "2.23.1",
55
"description": "An offline desktop reader for manga, comics, and novels. Offers a customizable reading experience with extensive settings, shortcuts, themes and layouts.",
66
"main": ".webpack/main",
77
"author": {

src/electron/ipc/update.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import { ipc } from "./utils";
66

77
export const registerUpdateHandlers = (): void => {
88
if (MainSettings.settings.checkForUpdates) {
9-
const mainWindow = WindowManager.getAllWindows()[0];
10-
if (mainWindow) {
11-
const check = () => {
12-
const settings = MainSettings.settings;
13-
checkForUpdate(mainWindow.id, settings.channel, settings.skipPatch, false, settings.autoDownload);
14-
};
15-
check();
16-
setInterval(check, 1000 * 60 * 60 * 1);
17-
}
9+
const check = () => {
10+
const settings = MainSettings.settings;
11+
const firstWindow = WindowManager.getAllWindows().find((w) => !w?.isDestroyed());
12+
if (firstWindow) {
13+
checkForUpdate(firstWindow.id, settings.channel, settings.skipPatch, false, settings.autoDownload);
14+
}
15+
};
16+
check();
17+
setInterval(check, 1000 * 60 * 60 * 1);
1818
}
1919

2020
ipc.on("update:check:manual", (e, { promptAfterCheck = true }) => {

0 commit comments

Comments
 (0)