From 001ca8b49f1d923a1967f72bacc03d0351a55c61 Mon Sep 17 00:00:00 2001 From: Oj Date: Wed, 6 Apr 2022 20:54:04 +0100 Subject: [PATCH] [Bootstrap] Fix issues from last commit --- src/bootstrap.js | 4 ++++ src/splash/index.js | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bootstrap.js b/src/bootstrap.js index e984914..c236262 100644 --- a/src/bootstrap.js +++ b/src/bootstrap.js @@ -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 diff --git a/src/splash/index.js b/src/splash/index.js index 6e11264..f32307f 100644 --- a/src/splash/index.js +++ b/src/splash/index.js @@ -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); };