Fix: Splashscreen Appears on Boot

This commit is contained in:
Youwes09
2026-05-22 21:39:29 -05:00
parent 081becdd60
commit 6c39ef538f
3 changed files with 27 additions and 15 deletions
+1
View File
@@ -80,6 +80,7 @@
exiting = false exiting = false
return return
} }
if (failed || notConfigured) return
triggerExit(onReady) triggerExit(onReady)
}) })
+17 -7
View File
@@ -12,23 +12,33 @@
const isTauri = typeof window !== 'undefined' && '__TAURI_INTERNALS__' in window const isTauri = typeof window !== 'undefined' && '__TAURI_INTERNALS__' in window
const ringFull = $derived(appState.status !== 'booting') const ringFull = $derived(appState.status !== 'booting')
const splashDone = $derived(
let splashVisible = $state(true)
let bypassed = $state(false)
const showApp = $derived(
appState.status === 'ready' || appState.status === 'ready' ||
appState.status === 'auth' || appState.status === 'auth' ||
appState.status === 'error' bypassed
) )
let bypassed = $state(false) function onSplashReady() {
const showApp = $derived(splashDone && (appState.status === 'ready' || appState.status === 'auth' || bypassed)) splashVisible = false
}
function onSplashBypass() {
bypassed = true
splashVisible = false
}
</script> </script>
{#if !showApp} {#if splashVisible}
<SplashScreen <SplashScreen
mode="loading" mode="loading"
{ringFull} {ringFull}
failed={appState.status === 'error'} failed={appState.status === 'error'}
onReady={() => {}} onReady={onSplashReady}
onBypass={() => (bypassed = true)} onBypass={onSplashBypass}
onRetry={() => window.location.reload()} onRetry={() => window.location.reload()}
/> />
{/if} {/if}
+3 -2
View File
@@ -1,2 +1,3 @@
<h1>Welcome to SvelteKit</h1> <script lang="ts">
<p>Visit <a href="https://svelte.dev/docs/kit">svelte.dev/docs/kit</a> to read the documentation</p>
</script>