Create a splashscreen that makes sure that the requirements are met

This commit is contained in:
Sebastian Martinez
2024-08-28 10:50:09 +02:00
committed by Rūdolfs Ošiņš
parent cf2f43e465
commit a03a0aef3a
3 changed files with 41 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

+2
View File
@@ -1,3 +1,5 @@
<script lang="ts">
import Startup from "./views/Startup.svelte";
</script>
<Startup />
+39
View File
@@ -0,0 +1,39 @@
<script lang="ts">
import { invoke } from "@tauri-apps/api/core";
import { onMount } from "svelte";
import warningIcon from "/images/warning.png";
let loading = true;
let error: { err: string; hint?: string } | undefined = undefined;
onMount(async () => {
try {
await invoke("authenticate");
} catch (e: any) {
error = e;
} finally {
loading = false;
}
});
</script>
<style>
main {
padding-top: 7rem;
margin: 0 auto;
width: 100%;
text-align: center;
}
</style>
<main>
{#if error}
<img height="32" src={warningIcon} alt="warning" />
<p class="txt-medium">{error.err}</p>
{#if error.hint}
<p class="txt-small">{@html error.hint}</p>
{/if}
{:else if !loading}
<p class="txt-medium">You are all set!</p>
{/if}
</main>