mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 06:10:44 +08:00
Create a splashscreen that makes sure that the requirements are met
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 437 B |
@@ -1,3 +1,5 @@
|
||||
<script lang="ts">
|
||||
import Startup from "./views/Startup.svelte";
|
||||
</script>
|
||||
|
||||
<Startup />
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user