refactor: ♻️ Make auth store require less null checks

This commit is contained in:
Jesse Wierzbinski 2026-01-09 22:35:46 +01:00
parent 68e23a818a
commit b23ed66401
No known key found for this signature in database
32 changed files with 111 additions and 124 deletions

View file

@ -32,9 +32,9 @@ const copy = (data: string) => {
const authStore = useAuthStore();
const data: [string, string | VNode][] = [
["User ID", authStore.account?.id ?? ""],
["Instance domain", authStore.instance?.domain ?? ""],
["Instance version", authStore.instance?.versia_version ?? ""],
["User ID", authStore.account.id],
["Instance domain", authStore.instance.domain],
["Instance version", authStore.instance.versia_version ?? ""],
["Client ID", authStore.application?.client_id ?? ""],
[
"Client secret",
@ -55,7 +55,7 @@ const data: [string, string | VNode][] = [
class="font-sans"
size="sm"
// @ts-expect-error missing onClick types
onClick={() => copy(authStore.token?.access_token ?? "")}
onClick={() => copy(authStore.token.access_token)}
>
Click to copy
</Button>,