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); };