mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
perf: ♻️ Use global instance of composable instead of an instance per component for identities, client and settings
This commit is contained in:
parent
f1ada1745d
commit
3428e4b5b6
38 changed files with 104 additions and 131 deletions
|
|
@ -20,7 +20,6 @@ definePageMeta({
|
|||
|
||||
const element = ref<HTMLElement | null>(null);
|
||||
const route = useRoute();
|
||||
const client = useClient();
|
||||
const uuid = route.params.uuid as string;
|
||||
|
||||
const note = useNote(client, uuid);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ definePageMeta({
|
|||
});
|
||||
|
||||
const route = useRoute();
|
||||
const client = useClient();
|
||||
const username = (route.params.username as string).startsWith("@")
|
||||
? (route.params.username as string).substring(1)
|
||||
: (route.params.username as string);
|
||||
|
|
|
|||
|
|
@ -28,5 +28,4 @@ import TimelineScroller from "~/components/timelines/timeline-scroller.vue";
|
|||
definePageMeta({
|
||||
layout: "app",
|
||||
});
|
||||
const identity = useCurrentIdentity();
|
||||
</script>
|
||||
|
|
@ -76,7 +76,6 @@ import Label from "~/components/inputs/label.vue";
|
|||
import PasswordInput from "~/components/inputs/password-input.vue";
|
||||
import Button from "~/packages/ui/components/buttons/button.vue";
|
||||
|
||||
const identity = useCurrentIdentity();
|
||||
identity.value = null;
|
||||
|
||||
const schema = toTypedSchema(
|
||||
|
|
|
|||
|
|
@ -84,7 +84,8 @@
|
|||
cannot see your password.
|
||||
</p>
|
||||
|
||||
<Button theme="primary" type="submit" class="w-full" :disabled="isLoading">{{ isLoading ? "Registering..." :
|
||||
<Button theme="primary" type="submit" class="w-full" :disabled="isLoading">{{ isLoading ?
|
||||
"Registering..." :
|
||||
"Register" }}</Button>
|
||||
</VeeForm>
|
||||
</div>
|
||||
|
|
@ -140,7 +141,6 @@ const schema = toTypedSchema(
|
|||
}),
|
||||
);
|
||||
|
||||
const client = useClient();
|
||||
const tos = useTos(client);
|
||||
|
||||
const errors = ref<{
|
||||
|
|
|
|||
|
|
@ -33,6 +33,4 @@ import { SettingPages, getSettingsForPath } from "~/settings";
|
|||
definePageMeta({
|
||||
layout: "app",
|
||||
});
|
||||
|
||||
const settings = useSettings();
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue