This commit is contained in:
2025-12-31 21:24:37 +08:00
parent ed3e0a21ae
commit 401923ef4c
8 changed files with 140 additions and 3 deletions

View File

@@ -2,11 +2,27 @@
import { invoke } from "@tauri-apps/api/core";
import { appData } from "../../../events/app-data";
import Power from "../../../assets/icons/power.svelte";
let signingOut = false;
async function handleSignOut() {
if (signingOut) return;
signingOut = true;
try {
await invoke("logout_and_restart");
} catch (error) {
console.error("Failed to sign out", error);
signingOut = false;
}
}
</script>
<div class="size-full flex flex-col justify-between">
<div>
<div class="flex flex-col gap-2">
<p>{$appData?.user?.name}'s preferences</p>
<button class="btn" class:btn-disabled={signingOut} onclick={handleSignOut}>
{signingOut ? "Signing out..." : "Sign out"}
</button>
</div>
<div class="w-full flex flex-row justify-between">
<div></div>