summaryrefslogtreecommitdiffhomepage
path: root/gui/src
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2021-07-16 10:29:30 +0200
committerOskar Nyberg <oskar@mullvad.net>2021-07-16 13:02:14 +0200
commit35309868a2c88228e891516e4d7cfc77a9bd8df0 (patch)
tree9210ae31100d1c3963bca8d5dd6e6c66ae7a30d9 /gui/src
parent051edd1fe2eacf809c02ceb4b7c6667af8317608 (diff)
downloadmullvadvpn-35309868a2c88228e891516e4d7cfc77a9bd8df0.tar.xz
mullvadvpn-35309868a2c88228e891516e4d7cfc77a9bd8df0.zip
Show window after finished loading content
Diffstat (limited to 'gui/src')
-rw-r--r--gui/src/main/window-controller.ts12
1 files changed, 2 insertions, 10 deletions
diff --git a/gui/src/main/window-controller.ts b/gui/src/main/window-controller.ts
index 450123d035..50ceab01e4 100644
--- a/gui/src/main/window-controller.ts
+++ b/gui/src/main/window-controller.ts
@@ -133,7 +133,6 @@ export default class WindowController {
private windowValue: BrowserWindow;
private webContentsValue: WebContents;
private windowPositioning: IWindowPositioning;
- private isWindowReady = false;
get window(): BrowserWindow | undefined {
return this.windowValue.isDestroyed() ? undefined : this.windowValue;
@@ -154,7 +153,6 @@ export default class WindowController {
: new AttachedToTrayWindowPositioning(tray);
this.installDisplayMetricsHandler();
- this.installWindowReadyHandlers();
}
public replaceWindow(window: BrowserWindow, unpinnedWindow: boolean) {
@@ -269,17 +267,11 @@ export default class WindowController {
this.window?.setSize(this.width, this.height);
}
- private installWindowReadyHandlers() {
- this.window?.once('ready-to-show', () => {
- this.isWindowReady = true;
- });
- }
-
private executeWhenWindowIsReady(closure: () => void) {
- if (this.isWindowReady) {
+ if (this.webContents?.isLoading() === false && this.webContents?.getURL() !== '') {
closure();
} else {
- this.window?.once('ready-to-show', () => {
+ this.webContents?.once('did-stop-loading', () => {
closure();
});
}