summaryrefslogtreecommitdiff
path: root/packages/frontend/src/composables/use-note-capture.ts
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-06-01 08:10:49 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2025-06-01 08:10:49 +0900
commit5bdbff19ae4feaa39b0d3241c233236bfcd3179e (patch)
tree8f2ee89d4c6bfe4d61e9924204ee38783de9e93c /packages/frontend/src/composables/use-note-capture.ts
parent🎨 (diff)
downloadmisskey-5bdbff19ae4feaa39b0d3241c233236bfcd3179e.tar.gz
misskey-5bdbff19ae4feaa39b0d3241c233236bfcd3179e.tar.bz2
misskey-5bdbff19ae4feaa39b0d3241c233236bfcd3179e.zip
fix(frontend): リアクションの一部の絵文字が重複して表示されることがある問題を修正
Fix #16130
Diffstat (limited to 'packages/frontend/src/composables/use-note-capture.ts')
-rw-r--r--packages/frontend/src/composables/use-note-capture.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/packages/frontend/src/composables/use-note-capture.ts b/packages/frontend/src/composables/use-note-capture.ts
index 90a5922b3e..2aeb9074e5 100644
--- a/packages/frontend/src/composables/use-note-capture.ts
+++ b/packages/frontend/src/composables/use-note-capture.ts
@@ -194,9 +194,9 @@ export function useNoteCapture(props: {
parentNote: Misskey.entities.Note | null;
mock?: boolean;
}): {
- $note: Reactive<ReactiveNoteData>;
- subscribe: () => void;
-} {
+ $note: Reactive<ReactiveNoteData>;
+ subscribe: () => void;
+ } {
const { note, parentNote, mock } = props;
const $note = reactive<ReactiveNoteData>({
@@ -225,8 +225,8 @@ export function useNoteCapture(props: {
let latestPollVotedKey: string | null = null;
function onReacted(ctx: { userId: Misskey.entities.User['id']; reaction: string; emoji?: { name: string; url: string; }; }): void {
- const normalizedName = ctx.reaction.replace(/^:(\w+):$/, ':$1@.:');
-
+ let normalizedName = ctx.reaction.replace(/^:(\w+):$/, ':$1@.:');
+ normalizedName = normalizedName.match('\u200d') ? normalizedName : normalizedName.replace(/\ufe0f/g, '');
if (reactionUserMap.has(ctx.userId) && reactionUserMap.get(ctx.userId) === normalizedName) return;
reactionUserMap.set(ctx.userId, normalizedName);
@@ -245,7 +245,8 @@ export function useNoteCapture(props: {
}
function onUnreacted(ctx: { userId: Misskey.entities.User['id']; reaction: string; emoji?: { name: string; url: string; }; }): void {
- const normalizedName = ctx.reaction.replace(/^:(\w+):$/, ':$1@.:');
+ let normalizedName = ctx.reaction.replace(/^:(\w+):$/, ':$1@.:');
+ normalizedName = normalizedName.match('\u200d') ? normalizedName : normalizedName.replace(/\ufe0f/g, '');
// 確実に一度リアクションされて取り消されている場合のみ処理をとめる(APIで初回読み込み→Streamでアップデート等の場合、reactionUserMapに情報がないため)
if (reactionUserMap.has(ctx.userId) && reactionUserMap.get(ctx.userId) === noReaction) return;