summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2025-05-24 18:31:55 +0900
committerGitHub <noreply@github.com>2025-05-24 18:31:55 +0900
commit02041344bdc2ac39c67d9b01e88d65c983059dcb (patch)
tree57bb18c5a3d06925d9ad965d9e9efb566bc4a7d7 /packages/frontend/src/components
parentBump version to 2025.5.1-beta.1 (diff)
downloadmisskey-02041344bdc2ac39c67d9b01e88d65c983059dcb.tar.gz
misskey-02041344bdc2ac39c67d9b01e88d65c983059dcb.tar.bz2
misskey-02041344bdc2ac39c67d9b01e88d65c983059dcb.zip
fix(frontend); カスタム絵文字のリアクションが二重で表示されることがある問題を修正 (#16092)
* fix(frontend): カスタム絵文字のリアクションが二重で表示されることがある問題を修正 * fix: improve event locking mechanism * fix: remove unused console log * fix: unused import * fix: その場で書き換えることで再レンダリングを最小限に抑える(かも) * refactor: reactive note data を composable内で生成するように
Diffstat (limited to 'packages/frontend/src/components')
-rw-r--r--packages/frontend/src/components/MkNote.vue23
-rw-r--r--packages/frontend/src/components/MkNoteDetailed.vue17
2 files changed, 9 insertions, 31 deletions
diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue
index ee8a470b0e..4a78d00665 100644
--- a/packages/frontend/src/components/MkNote.vue
+++ b/packages/frontend/src/components/MkNote.vue
@@ -193,7 +193,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<script lang="ts" setup>
-import { computed, inject, onMounted, ref, useTemplateRef, watch, provide, shallowRef, reactive } from 'vue';
+import { computed, inject, onMounted, ref, useTemplateRef, provide } from 'vue';
import * as mfm from 'mfm-js';
import * as Misskey from 'misskey-js';
import { isLink } from '@@/js/is-link.js';
@@ -283,12 +283,10 @@ if (noteViewInterruptors.length > 0) {
const isRenote = Misskey.note.isPureRenote(note);
const appearNote = getAppearNote(note);
-const $appearNote = reactive({
- reactions: appearNote.reactions,
- reactionCount: appearNote.reactionCount,
- reactionEmojis: appearNote.reactionEmojis,
- myReaction: appearNote.myReaction,
- pollChoices: appearNote.poll?.choices,
+const { $note: $appearNote, subscribe: subscribeManuallyToNoteCapture } = useNoteCapture({
+ note: appearNote,
+ parentNote: note,
+ mock: props.mock,
});
const rootEl = useTemplateRef('rootEl');
@@ -410,17 +408,6 @@ provide(DI.mfmEmojiReactCallback, (reaction) => {
});
});
-let subscribeManuallyToNoteCapture: () => void = () => { };
-
-if (!props.mock) {
- const { subscribe } = useNoteCapture({
- note: appearNote,
- parentNote: note,
- $note: $appearNote,
- });
- subscribeManuallyToNoteCapture = subscribe;
-}
-
if (!props.mock) {
useTooltip(renoteButton, async (showing) => {
const renotes = await misskeyApi('notes/renotes', {
diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue
index 767f4c88ce..e090901875 100644
--- a/packages/frontend/src/components/MkNoteDetailed.vue
+++ b/packages/frontend/src/components/MkNoteDetailed.vue
@@ -228,7 +228,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<script lang="ts" setup>
-import { computed, inject, onMounted, provide, reactive, ref, useTemplateRef } from 'vue';
+import { computed, inject, onMounted, provide, ref, useTemplateRef } from 'vue';
import * as mfm from 'mfm-js';
import * as Misskey from 'misskey-js';
import { isLink } from '@@/js/is-link.js';
@@ -304,12 +304,9 @@ if (noteViewInterruptors.length > 0) {
const isRenote = Misskey.note.isPureRenote(note);
const appearNote = getAppearNote(note);
-const $appearNote = reactive({
- reactions: appearNote.reactions,
- reactionCount: appearNote.reactionCount,
- reactionEmojis: appearNote.reactionEmojis,
- myReaction: appearNote.myReaction,
- pollChoices: appearNote.poll?.choices,
+const { $note: $appearNote, subscribe: subscribeManuallyToNoteCapture } = useNoteCapture({
+ note: appearNote,
+ parentNote: note,
});
const rootEl = useTemplateRef('rootEl');
@@ -397,12 +394,6 @@ const reactionsPagination = computed(() => ({
},
}));
-const { subscribe: subscribeManuallyToNoteCapture } = useNoteCapture({
- note: appearNote,
- parentNote: note,
- $note: $appearNote,
-});
-
useTooltip(renoteButton, async (showing) => {
const renotes = await misskeyApi('notes/renotes', {
noteId: appearNote.id,