refactor: ♻️ Rewrite authentication page

This commit is contained in:
Jesse Wierzbinski 2024-12-02 17:20:27 +01:00
parent 1194bc4ffb
commit c483f35b99
No known key found for this signature in database
26 changed files with 373 additions and 797 deletions

View file

@ -4,14 +4,16 @@ import type { Account } from "@versia/client/types";
export const useAccountFromAcct = (
client: MaybeRef<Client | null>,
acct: string,
): Ref<Account | null> => {
): { account: Ref<Account | null>; isLoading: Ref<boolean> } => {
const output = ref(null as Account | null);
const isLoading = ref(true);
ref(client)
.value?.lookupAccount(acct)
.then((res) => {
isLoading.value = false;
output.value = res.data;
});
return output;
return { account: output, isLoading };
};