-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a splashscreen that makes sure that the requirements are met
- Loading branch information
1 parent
21841b4
commit 150291c
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |