fix(frontend): リアクションの一部の絵文字が重複して表示されることがある問題を修正

Fix #16130
This commit is contained in:
syuilo 2025-06-01 08:10:49 +09:00
parent 070a4516fc
commit 5bdbff19ae
2 changed files with 8 additions and 7 deletions

View File

@ -4,7 +4,7 @@
-
### Client
-
- Fix: リアクションの一部の絵文字が重複して表示されることがある問題を修正
### Server
-

View File

@ -196,7 +196,7 @@ export function useNoteCapture(props: {
}): {
$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;