diff --git a/ui/src/app/LoadingApp.svelte b/ui/src/app/LoadingApp.svelte new file mode 100644 index 0000000..ecf2d0b --- /dev/null +++ b/ui/src/app/LoadingApp.svelte @@ -0,0 +1,10 @@ +
+
+ +
+
+ + diff --git a/ui/src/app/main.js b/ui/src/app/main.js index 3b27e31..7cd3c86 100644 --- a/ui/src/app/main.js +++ b/ui/src/app/main.js @@ -9,8 +9,14 @@ import {wasm} from './stores' // Svelte app import App from './App.svelte' +import LoadingApp from './LoadingApp.svelte' ;(async function main() { + // Show the LoadingApp component while the app is initializing + const loading = new LoadingApp({ + target: document.body, + }) + // Register the service worker and wait for its activation try { await navigator.serviceWorker.register('sw.js') @@ -25,8 +31,12 @@ import App from './App.svelte' console.error('Service worker registration failed with ' + err) } + // Force-enable Wasm in development await enableWasm(true) + // Remove the loading component + loading.$destroy() + // Initialize the Svelte app and inject it in the DOM new App({ target: document.body,