refactor: ♻️ Rewrite state system to use Pinia for composer and auth

This commit is contained in:
Jesse Wierzbinski 2025-08-28 07:41:51 +02:00
parent a6db9e059d
commit b510782a30
No known key found for this signature in database
80 changed files with 999 additions and 1011 deletions

View file

@ -25,13 +25,13 @@ const copy = (data: string) => {
toast.success("Copied to clipboard");
};
const appData = useAppData();
const authStore = useAuthStore();
const data: [string, string | VNode][] = [
["User ID", identity.value?.account.id ?? ""],
["Instance domain", identity.value?.instance.domain ?? ""],
["Instance version", identity.value?.instance.versia_version ?? ""],
["Client ID", appData.value?.client_id ?? ""],
["User ID", authStore.account?.id ?? ""],
["Instance domain", authStore.instance?.domain ?? ""],
["Instance version", authStore.instance?.versia_version ?? ""],
["Client ID", authStore.application?.client_id ?? ""],
[
"Client secret",
<Button
@ -39,7 +39,7 @@ const data: [string, string | VNode][] = [
class="font-sans"
size="sm"
// @ts-expect-error missing onClick types
onClick={() => copy(appData.value?.client_secret ?? "")}
onClick={() => copy(authStore.application?.client_secret ?? "")}
>
Click to copy
</Button>,
@ -51,7 +51,7 @@ const data: [string, string | VNode][] = [
class="font-sans"
size="sm"
// @ts-expect-error missing onClick types
onClick={() => copy(identity.value?.tokens.access_token ?? "")}
onClick={() => copy(authStore.token?.access_token ?? "")}
>
Click to copy
</Button>,