mirror of
https://github.com/moku-project/Moku.git
synced 2026-06-13 17:29:55 -05:00
Fix: Splashscreen Appears on Boot
This commit is contained in:
@@ -80,6 +80,7 @@
|
|||||||
exiting = false
|
exiting = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (failed || notConfigured) return
|
||||||
triggerExit(onReady)
|
triggerExit(onReady)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|||||||
@@ -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>
|
||||||
Reference in New Issue
Block a user