[Bootstrap] Only run splash pageReady once on dom-ready

This commit is contained in:
Ducko 2021-12-27 22:51:22 +00:00
parent 2baf6ff7cc
commit 1a7d927d9c
1 changed files with 6 additions and 2 deletions

8
src/bootstrap.js vendored
View File

@ -68,8 +68,12 @@ const startCore = () => {
const bw = BrowserWindow.fromId(global.mainWindowId);
let donePageReady = false;
bw.webContents.on('dom-ready', () => {
splashScreen.pageReady(); // Override Core's pageReady with our own on dom-ready to show main window earlier
if (!donePageReady) { // Only run once
splashScreen.pageReady(); // Override Core's pageReady with our own on dom-ready to show main window earlier
donePageReady = true;
}
log('MainWindowInject', 'dom-ready triggered, injecting JS');
@ -144,4 +148,4 @@ getInstallPath: ${paths.getInstallPath()}`);
} else {
app.once('ready', startUpdate);
}
};
};