diff --git a/components/composer/modal.vue b/components/composer/modal.vue index 7ecb889..52932de 100644 --- a/components/composer/modal.vue +++ b/components/composer/modal.vue @@ -37,8 +37,7 @@ useListen("note:quote", async (note) => { useEvent("composer:quote", note); }); useListen("composer:open", () => { - if (tokenData.value) - open.value = true; + if (tokenData.value) open.value = true; }); useListen("composer:close", () => { open.value = false; diff --git a/components/social-elements/notes/note-content.vue b/components/social-elements/notes/note-content.vue index d65f645..4486bb1 100644 --- a/components/social-elements/notes/note-content.vue +++ b/components/social-elements/notes/note-content.vue @@ -29,7 +29,7 @@ \ No newline at end of file diff --git a/composables/Account.ts b/composables/Account.ts index d32f1b8..e84dcee 100644 --- a/composables/Account.ts +++ b/composables/Account.ts @@ -3,7 +3,7 @@ import type { Account } from "~/types/mastodon/account"; export const useAccount = ( client: MaybeRef, - accountId: string, + accountId: MaybeRef, ) => { if (!client) { return ref(null as Account | null); @@ -11,11 +11,14 @@ export const useAccount = ( const output = ref(null as Account | null); - ref(client) - .value?.getAccount(accountId) - .then((res) => { - output.value = res.data; - }); + watchEffect(() => { + if (toValue(accountId)) + ref(client) + .value?.getAccount(toValue(accountId) ?? "") + .then((res) => { + output.value = res.data; + }); + }); return output; }; diff --git a/composables/NoteData.ts b/composables/NoteData.ts index 64998fa..571df36 100644 --- a/composables/NoteData.ts +++ b/composables/NoteData.ts @@ -5,6 +5,7 @@ export const useNoteData = ( noteProp: MaybeRef, client: Ref, ) => { + const isReply = computed(() => !!toValue(noteProp)?.in_reply_to_id); const isQuote = computed(() => !!toValue(noteProp)?.quote); const isReblog = computed( () => !isQuote.value && !!toValue(noteProp)?.reblog, @@ -54,7 +55,7 @@ export const useNoteData = ( ); if (result?.data) { - useEvent("note:delete", result.data); + useEvent("note:delete", result.data as Status); } }; @@ -66,6 +67,7 @@ export const useNoteData = ( reblog, reblogDisplayName, shouldHide, + isReply, url, remove, };