Skip to content

Commit c418406

Browse files
committed
event onShow after cache updater window
1 parent becbe52 commit c418406

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "electron-gp",
33
"private": true,
4-
"version": "0.2.11",
4+
"version": "0.2.12",
55
"type": "module",
66
"main": "dist-main/app.js",
77
"author": "traeop",

src/main/updater/ipc.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import type {
88
} from "../@core/types/ipc-handler.js";
99
import { ipcMainOn } from "../$shared/utils.js";
1010
import { TrayService } from "../tray/service.js";
11-
import { CheckForUpdatesService } from "./services/check-for-updates.js";
1211
import { OpenLatestVersionService } from "./services/mac-os/open-latest-version.js";
1312

1413
const { autoUpdater } = pkg;
@@ -19,7 +18,6 @@ export class UpdaterIpc implements TIpcHandlerInterface {
1918

2019
constructor(
2120
private trayService: TrayService,
22-
private checkForUpdatesService: CheckForUpdatesService,
2321
private openLatestVersionService: OpenLatestVersionService
2422
) {}
2523

@@ -35,8 +33,6 @@ export class UpdaterIpc implements TIpcHandlerInterface {
3533
} else {
3634
this.updateAppWindow = await updateAppWindow.create();
3735
}
38-
39-
this.checkForUpdatesService.checkForUpdates();
4036
};
4137
}
4238

src/main/updater/window.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,19 @@ import { CheckForUpdatesService } from "./services/check-for-updates.js";
1616
},
1717
})
1818
export class UpdaterWindow implements TWindowManager {
19+
private isCheckFirst = true;
1920
constructor(private checkForUpdatesService: CheckForUpdatesService) {}
2021

2122
onDidFinishLoad(): void {
22-
this.checkForUpdatesService.checkForUpdates();
23+
if (this.isCheckFirst) {
24+
this.checkForUpdatesService.checkForUpdates();
25+
this.isCheckFirst = false;
26+
}
27+
}
28+
29+
onShow() {
30+
if (!this.isCheckFirst) {
31+
this.checkForUpdatesService.checkForUpdates();
32+
}
2333
}
2434
}

0 commit comments

Comments
 (0)