From e53e274d1d3c1d5928a4ce7fc9d12ddfbcea905f Mon Sep 17 00:00:00 2001 From: Natty Date: Mon, 6 Nov 2023 02:54:02 +0100 Subject: [PATCH] Frontend: Fixed more reaction bugs --- .../frontend/client/src/components/MkNoteSub.vue | 10 ++++------ .../frontend/client/src/components/MkRenoteButton.vue | 6 ++---- fe_calckey/frontend/client/src/scripts-mag/mag-util.ts | 2 +- .../frontend/client/src/scripts/use-note-capture.ts | 5 ++++- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/fe_calckey/frontend/client/src/components/MkNoteSub.vue b/fe_calckey/frontend/client/src/components/MkNoteSub.vue index 1d95768..a0dac03 100644 --- a/fe_calckey/frontend/client/src/components/MkNoteSub.vue +++ b/fe_calckey/frontend/client/src/components/MkNoteSub.vue @@ -95,12 +95,10 @@ class="button" :note="appearNote" :count=" - Number( - magTransProperty( - appearNote, - 'renote_count', - 'renoteCount' - ) + magTransProperty( + appearNote, + 'renote_count', + 'renoteCount' ) " /> diff --git a/fe_calckey/frontend/client/src/components/MkRenoteButton.vue b/fe_calckey/frontend/client/src/components/MkRenoteButton.vue index cb3e382..ef88156 100644 --- a/fe_calckey/frontend/client/src/components/MkRenoteButton.vue +++ b/fe_calckey/frontend/client/src/components/MkRenoteButton.vue @@ -59,10 +59,8 @@ const hasRenotedBefore = ref( const canRenote = computed( () => - ["public", "home"].includes(props.note.visibility) || - ($i && - magTransMap(props.note, "user", "userId", (user) => user.id) === - $i.id) + ["public", "home", "Public", "Home"].includes(props.note.visibility) || + ($i && props.note.user.id === $i.id) ); useTooltip(buttonRef, async (showing) => { diff --git a/fe_calckey/frontend/client/src/scripts-mag/mag-util.ts b/fe_calckey/frontend/client/src/scripts-mag/mag-util.ts index e7eb914..4ad03ac 100644 --- a/fe_calckey/frontend/client/src/scripts-mag/mag-util.ts +++ b/fe_calckey/frontend/client/src/scripts-mag/mag-util.ts @@ -195,7 +195,7 @@ export function magReactionToLegacy(reaction: types.Reaction | string): string { if (reaction.host) { return `:${reaction.name}@${reaction.host}:`; } else { - return `:${reaction.name}@.:`; + return `:${reaction.name}:`; } } diff --git a/fe_calckey/frontend/client/src/scripts/use-note-capture.ts b/fe_calckey/frontend/client/src/scripts/use-note-capture.ts index fafe154..4abfae3 100644 --- a/fe_calckey/frontend/client/src/scripts/use-note-capture.ts +++ b/fe_calckey/frontend/client/src/scripts/use-note-capture.ts @@ -45,7 +45,10 @@ export function useNoteCapture(props: { } } - const reactionType = magConvertReaction(reaction); + const reactionType = magConvertReaction( + reaction, + body?.emoji?.url + ); const foundReaction = magReactionIndex( note.value.reactions, reactionType