Skip to content

Commit

Permalink
Create a splashscreen that makes sure that the requirements are met
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastinez committed Aug 26, 2024
1 parent 21841b4 commit 150291c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
Binary file added public/images/warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/App.svelte
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<script lang="ts">
import Startup from "./views/Startup.svelte";
</script>

<Startup />
39 changes: 39 additions & 0 deletions src/views/Startup.svelte
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 150291c

Please sign in to comment.