perf: ♻️ Use global instance of composable instead of an instance per component for identities, client and settings

This commit is contained in:
Jesse Wierzbinski 2024-07-21 15:33:32 +02:00
parent f1ada1745d
commit 3428e4b5b6
No known key found for this signature in database
38 changed files with 104 additions and 131 deletions

View file

@ -1,9 +1,9 @@
<template>
<a :href="`/@${account.acct}`"
class="shrink break-all rounded bg-primary-700/80 text-primary-200 px-2 py-1 not-prose font-semibold cursor-pointer [&:not(:last-child)]:mr-1 duration-200 hover:bg-primary-600/30">
class="shrink break-all rounded bg-dark-200 ring-1 ring-white/5 ring-inset text-primary-200 px-2 py-1 not-prose font-semibold cursor-pointer [&:not(:last-child)]:mr-1 duration-200 hover:bg-primary-600/30">
<img class="size-[1em] rounded ring-1 ring-white/5 !inline align-middle mb-1 mr-1" :src="account.avatar"
:alt="`${account.acct}'s avatar'`" />
{{ account.display_name }}
{{ account.display_name || account.acct }}
</a>
</template>

View file

@ -176,9 +176,6 @@ useListen("composer:send-edit", (note) => {
}
});
const client = useClient();
const identity = useCurrentIdentity();
const settings = useSettings();
const {
loaded,
note: outputtedNote,

View file

@ -18,6 +18,5 @@ const props = defineProps<{
account_id: string | null;
}>();
const client = useClient();
const account = useAccount(client, props.account_id);
</script>