mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 11:39: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
|
|
@ -60,7 +60,6 @@ const { Control_Enter, Command_Enter, Control_Alt } = useMagicKeys();
|
|||
const content = ref("");
|
||||
const respondingTo = ref<Status | null>(null);
|
||||
const respondingType = ref<"reply" | "quote" | "edit" | null>(null);
|
||||
const identity = useCurrentIdentity();
|
||||
const cw = ref(false);
|
||||
const cwContent = ref("");
|
||||
const markdown = ref(true);
|
||||
|
|
@ -178,7 +177,6 @@ const canSubmit = computed(
|
|||
(content.value?.trim().length > 0 || files.value.length > 0) &&
|
||||
content.value?.trim().length <= characterLimit.value,
|
||||
);
|
||||
const client = useClient();
|
||||
|
||||
const send = async () => {
|
||||
loading.value = true;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ defineProps<{
|
|||
textarea: HTMLTextAreaElement | undefined;
|
||||
}>();
|
||||
|
||||
const identity = useCurrentIdentity();
|
||||
const emojis = computed(
|
||||
() =>
|
||||
identity.value?.emojis.map((emoji) => ({
|
||||
|
|
|
|||
|
|
@ -74,7 +74,6 @@ const files = defineModel<
|
|||
required: true,
|
||||
});
|
||||
|
||||
const client = useClient();
|
||||
const fileInput = ref<HTMLInputElement | null>(null);
|
||||
|
||||
const openFilePicker = () => {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ const props = defineProps<{
|
|||
textarea: HTMLTextAreaElement | undefined;
|
||||
}>();
|
||||
|
||||
const client = useClient();
|
||||
const mentions = ref<{ key: string; value: Account }[]>([]);
|
||||
|
||||
watch(
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ import { Dialog } from "@ark-ui/vue";
|
|||
import Composer from "./composer.vue";
|
||||
const open = ref(false);
|
||||
|
||||
const identity = useCurrentIdentity();
|
||||
useListen("note:reply", async (note) => {
|
||||
open.value = true;
|
||||
await nextTick();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue