diff --git a/src/App.svelte b/src/App.svelte index ec97540..176c8be 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -16,7 +16,12 @@ onMount(async () => { try { - await invoke("authenticate"); + // For development purposes don't run tauri commands when viewing from + // a browser. + if (window.__TAURI_INTERNALS__) { + await invoke("authenticate"); + } + void router.push({ resource: "home" }); // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (e: any) { diff --git a/src/global.d.ts b/src/global.d.ts new file mode 100644 index 0000000..88c82d9 --- /dev/null +++ b/src/global.d.ts @@ -0,0 +1,8 @@ +declare global { + interface Window { + // eslint-disable-next-line @typescript-eslint/naming-convention + __TAURI_INTERNALS__: Record; + } +} + +export {};