[Bootstrap] Fix issues from last commit

This commit is contained in:
Ducko 2022-04-06 20:54:04 +01:00
parent a74141f34f
commit 001ca8b49f
2 changed files with 5 additions and 3 deletions

4
src/bootstrap.js vendored
View File

@ -80,7 +80,11 @@ const startUpdate = async () => {
if (!process.env.OPENASAR_NOSTART) startCore();
});
let done;
splash.events.once('APP_SHOULD_SHOW', () => {
if (done) return;
done = true;
desktopCore.setMainWindowVisible(!startMin);
setTimeout(() => { // Try to update our asar

View File

@ -38,7 +38,7 @@ exports.initSplash = (startMin = false) => {
};
exports.focusWindow = () => splashWindow?.focus?.();
exports.pageReady = () => destroySplash() && process.nextTick(() => events.emit('APP_SHOULD_SHOW'));
exports.pageReady = () => destroySplash() || process.nextTick(() => events.emit('APP_SHOULD_SHOW'));
const destroySplash = () => {
splashWindow?.setSkipTaskbar?.(true);
@ -49,8 +49,6 @@ const destroySplash = () => {
splashWindow.hide();
splashWindow.close();
splashWindow = null;
return true;
}, 100);
};