parent
070a4516fc
commit
5bdbff19ae
|
@ -4,7 +4,7 @@
|
||||||
-
|
-
|
||||||
|
|
||||||
### Client
|
### Client
|
||||||
-
|
- Fix: リアクションの一部の絵文字が重複して表示されることがある問題を修正
|
||||||
|
|
||||||
### Server
|
### Server
|
||||||
-
|
-
|
||||||
|
|
|
@ -196,7 +196,7 @@ export function useNoteCapture(props: {
|
||||||
}): {
|
}): {
|
||||||
$note: Reactive<ReactiveNoteData>;
|
$note: Reactive<ReactiveNoteData>;
|
||||||
subscribe: () => void;
|
subscribe: () => void;
|
||||||
} {
|
} {
|
||||||
const { note, parentNote, mock } = props;
|
const { note, parentNote, mock } = props;
|
||||||
|
|
||||||
const $note = reactive<ReactiveNoteData>({
|
const $note = reactive<ReactiveNoteData>({
|
||||||
|
@ -225,8 +225,8 @@ export function useNoteCapture(props: {
|
||||||
let latestPollVotedKey: string | null = null;
|
let latestPollVotedKey: string | null = null;
|
||||||
|
|
||||||
function onReacted(ctx: { userId: Misskey.entities.User['id']; reaction: string; emoji?: { name: string; url: string; }; }): void {
|
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;
|
if (reactionUserMap.has(ctx.userId) && reactionUserMap.get(ctx.userId) === normalizedName) return;
|
||||||
reactionUserMap.set(ctx.userId, normalizedName);
|
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 {
|
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に情報がないため)
|
// 確実に一度リアクションされて取り消されている場合のみ処理をとめる(APIで初回読み込み→Streamでアップデート等の場合、reactionUserMapに情報がないため)
|
||||||
if (reactionUserMap.has(ctx.userId) && reactionUserMap.get(ctx.userId) === noReaction) return;
|
if (reactionUserMap.has(ctx.userId) && reactionUserMap.get(ctx.userId) === noReaction) return;
|
||||||
|
|
Loading…
Reference in New Issue