diff --git a/locales/index.d.ts b/locales/index.d.ts
index e47e0ec94091..fe3691e29667 100644
--- a/locales/index.d.ts
+++ b/locales/index.d.ts
@@ -7824,6 +7824,20 @@ export interface Locale extends ILocale {
*/
"hideMutedNotes": string;
};
+ "_reactionMute": {
+ /**
+ * ミュートするリアクション
+ */
+ "muteReactions": string;
+ /**
+ * 改行で区切って設定します
+ */
+ "muteReactionsDescription": string;
+ /**
+ * リアクションの名前をスラッシュで囲むと正規表現になります。
+ */
+ "muteReactionsDescription2": string;
+ };
"_instanceMute": {
/**
* ミュートしたサーバーのユーザーへの返信を含めて、設定したサーバーの全てのノートとRenoteをミュートします。
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index bf411a0d6e5c..9ad4872b0b80 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -2046,6 +2046,11 @@ _wordMute:
muteWordsDescription2: "キーワードをスラッシュで囲むと正規表現になります。"
hideMutedNotes: "ミュートされた単語を含むノートを非表示にする"
+_reactionMute:
+ muteReactions: "ミュートするリアクション"
+ muteReactionsDescription: "改行で区切って設定します"
+ muteReactionsDescription2: "リアクションの名前をスラッシュで囲むと正規表現になります。"
+
_instanceMute:
instanceMuteDescription: "ミュートしたサーバーのユーザーへの返信を含めて、設定したサーバーの全てのノートとRenoteをミュートします。"
instanceMuteDescription2: "改行で区切って設定します"
diff --git a/packages/frontend/src/components/MkReactionsViewer.vue b/packages/frontend/src/components/MkReactionsViewer.vue
index 0d354ad21af0..fc1c10eda3ad 100644
--- a/packages/frontend/src/components/MkReactionsViewer.vue
+++ b/packages/frontend/src/components/MkReactionsViewer.vue
@@ -58,7 +58,16 @@ function onMockToggleReaction(emoji: string, count: number) {
if ($i && reactions.value) {
reactions.value = reactions.value.map(([reactionType, count]) => {
- if (reactionType === props.note.myReaction || !($i.mutedReactions.flat()).includes(reactionType)) {
+ const isMuted = $i.mutedReactions.flat().some(mutedReaction => {
+ if (mutedReaction.startsWith('/') && mutedReaction.endsWith('/')) {
+ const regex = new RegExp(mutedReaction.slice(1, -1));
+ return regex.test(reactionType);
+ } else {
+ return reactionType.includes(mutedReaction);
+ }
+ });
+
+ if (reactionType === props.note.myReaction || !isMuted) {
return [reactionType, count];
} else {
return ['🚮', count];
@@ -90,10 +99,18 @@ watch([() => props.note.reactions, () => props.maxNumber], ([newSource, maxNumbe
}
if ($i) {
reactions.value = newReactions.map(([reactionType, count]) => {
- if (reactionType === props.note.myReaction || !($i.mutedReactions.flat()).includes(reactionType)) {
+ const isMuted = $i.mutedReactions.flat().some(mutedReaction => {
+ if (mutedReaction.startsWith('/') && mutedReaction.endsWith('/')) {
+ const regex = new RegExp(mutedReaction.slice(1, -1));
+ return regex.test(reactionType);
+ } else {
+ return reactionType.includes(mutedReaction);
+ }
+ });
+ if (reactionType === props.note.myReaction || !isMuted) {
return [reactionType, count];
} else {
- return ['🚮️', count];
+ return ['🚮', count];
}
});
} else {
diff --git a/packages/frontend/src/pages/settings/mute-block.word-mute.vue b/packages/frontend/src/pages/settings/mute-block.word-mute.vue
index 16a00b8f86ef..2af72670da87 100644
--- a/packages/frontend/src/pages/settings/mute-block.word-mute.vue
+++ b/packages/frontend/src/pages/settings/mute-block.word-mute.vue
@@ -9,6 +9,7 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts._wordMute.muteWords }}
{{ i18n.ts._wordMute.muteWordsDescription }}
{{ i18n.ts._wordMute.muteWordsDescription2 }}
+ {{ i18n.ts._reactionMute.muteReactionsDescription }}
{{ i18n.ts._reactionMute.muteReactionsDescription2 }}
{{ i18n.ts.save }}