change launch/patch to storage property

This commit is contained in:
HorizonCode 2024-01-11 16:15:56 +01:00
parent dfa933fb87
commit 3588203527
2 changed files with 12 additions and 7 deletions

View File

@ -1,9 +1,8 @@
<script lang="ts">
import { Button, Checkbox } from "flowbite-svelte";
import Progressbar from "../lib/Progressbar.svelte";
import { launching, patch } from "./../storage/localStore";
let progressbarFix = true;
let launching = false;
let patch = true;
setTimeout(() => {
progressbarFix = false;
@ -19,15 +18,19 @@
<Button
color="light"
size="xl"
class="dark:active:!bg-gray-900 {launching
class="dark:active:!bg-gray-900 {$launching
? ''
: 'active:scale-95 '}transition-transform duration-75"
disabled={launching}
on:click={() => (launching = !launching)}>Launch</Button
disabled={$launching}
on:click={() => launching.set(!$launching)}>Launch</Button
>
<Checkbox
disabled={$launching}
bind:checked={$patch}
on:click={() => patch.set(!$patch)}>Patch</Checkbox
>
<Checkbox disabled={launching} bind:checked={patch}>Patch</Checkbox>
<div
class="w-full flex flex-col justify-center items-center gap-2 mt-2 {launching
class="w-full flex flex-col justify-center items-center gap-2 mt-2 {$launching
? 'animate-fadeIn '
: 'animate-fadeOut '}{progressbarFix ? '!opacity-0' : 'opacity-0'}"
>

View File

@ -3,5 +3,7 @@ import { Page } from "../consts/pages";
import type { User } from "../types/user";
export const startup = writable(false);
export const launching = writable(false);
export const patch = writable(true);
export const currentUser: Writable<undefined | User> = writable(undefined);
export const currentPage = writable(Page.Login);