diff --git a/packages/frontend/src/components/MkReactionsViewer.reaction.vue b/packages/frontend/src/components/MkReactionsViewer.reaction.vue index 6bbc5f62ea..7d76dffa5a 100644 --- a/packages/frontend/src/components/MkReactionsViewer.reaction.vue +++ b/packages/frontend/src/components/MkReactionsViewer.reaction.vue @@ -168,7 +168,6 @@ async function menu(ev) { os.confirm({ type: 'question', title: i18n.tsx.unmuteX({ x: isLocalCustomEmoji ? `:${emojiName.value}:` : props.reaction }), - text: i18n.ts.reloadToApplySetting, }).then(({ canceled }) => { if (canceled) return; unmuteEmoji(props.reaction); @@ -183,7 +182,6 @@ async function menu(ev) { os.confirm({ type: 'question', title: i18n.tsx.muteX({ x: isLocalCustomEmoji ? `:${emojiName.value}:` : props.reaction }), - text: i18n.ts.reloadToApplySetting, }).then(({ canceled }) => { if (canceled) return; muteEmoji(props.reaction); diff --git a/packages/frontend/src/components/global/MkCustomEmoji.vue b/packages/frontend/src/components/global/MkCustomEmoji.vue index dae99840ba..ed114d8d31 100644 --- a/packages/frontend/src/components/global/MkCustomEmoji.vue +++ b/packages/frontend/src/components/global/MkCustomEmoji.vue @@ -199,7 +199,6 @@ function mute() { os.confirm({ type: 'question', title: i18n.tsx.muteX({ x: titleEmojiName }), - text: i18n.ts.reloadToApplySetting, }).then(({ canceled }) => { if (canceled) { return; @@ -215,7 +214,6 @@ function unmute() { os.confirm({ type: 'question', title: i18n.tsx.unmuteX({ x: titleEmojiName }), - text: i18n.ts.reloadToApplySetting, }).then(({ canceled }) => { if (canceled) { return; diff --git a/packages/frontend/src/components/global/MkEmoji.vue b/packages/frontend/src/components/global/MkEmoji.vue index 7075ae32d2..792f9c7d6f 100644 --- a/packages/frontend/src/components/global/MkEmoji.vue +++ b/packages/frontend/src/components/global/MkEmoji.vue @@ -47,7 +47,6 @@ function mute() { os.confirm({ type: 'question', title: i18n.tsx.muteX({ x: props.emoji }), - text: i18n.ts.reloadToApplySetting, }).then(({ canceled }) => { if (canceled) { return; @@ -60,7 +59,6 @@ function unmute() { os.confirm({ type: 'question', title: i18n.tsx.unmuteX({ x: props.emoji }), - text: i18n.ts.reloadToApplySetting, }).then(({ canceled }) => { if (canceled) { return; diff --git a/packages/frontend/src/pages/settings/mute-block.emoji-mute.vue b/packages/frontend/src/pages/settings/mute-block.emoji-mute.vue index e687356f12..601ca7ee49 100644 --- a/packages/frontend/src/pages/settings/mute-block.emoji-mute.vue +++ b/packages/frontend/src/pages/settings/mute-block.emoji-mute.vue @@ -72,7 +72,6 @@ function unmute(emoji: string) { os.confirm({ type: 'question', title: i18n.tsx.unmuteX({ x: emoji }), - text: i18n.ts.reloadToApplySetting, }).then(({ canceled }) => { if (canceled) { return; diff --git a/packages/frontend/src/utility/emoji-mute.ts b/packages/frontend/src/utility/emoji-mute.ts index 494559dbd5..a058bcc242 100644 --- a/packages/frontend/src/utility/emoji-mute.ts +++ b/packages/frontend/src/utility/emoji-mute.ts @@ -11,12 +11,10 @@ export function makeEmojiMuteKey(props: { name: string; host?: string | null }) return props.name.startsWith(':') ? props.name : `:${props.name}${props.host ? `@${props.host}` : ''}:`; } -// custom絵文字の名前部分を取り出す export function extractCustomEmojiName (name:string) { return (name[0] === ':' ? name.substring(1, name.length - 1) : name).replace('@.', '').split('@')[0]; } -// custom絵文字のホスト部分を取り出す export function extractCustomEmojiHost (name:string) { // nameは:emojiName@host:の形式 // 取り出したい部分はhostなので、@以降を取り出す @@ -31,25 +29,27 @@ export function extractCustomEmojiHost (name:string) { return host; } -export async function mute(emoji: string) { +export function mute(emoji: string) { const isCustomEmoji = emoji.startsWith(':') && emoji.endsWith(':'); const emojiMuteKey = isCustomEmoji ? makeEmojiMuteKey({ name: extractCustomEmojiName(emoji), host: extractCustomEmojiHost(emoji) }) : emoji; - const mutedEmojis = prefer.s.mutingEmojis; + const mutedEmojis = prefer.r.mutingEmojis.value; if (!mutedEmojis.includes(emojiMuteKey)) { return prefer.commit('mutingEmojis', [...mutedEmojis, emojiMuteKey]); } throw new Error('Emoji is already muted', { cause: `${emojiMuteKey} is Already Muted` }); } -export async function unmute(emoji:string) { +export function unmute(emoji:string) { const isCustomEmoji = emoji.startsWith(':') && emoji.endsWith(':'); const emojiMuteKey = isCustomEmoji ? makeEmojiMuteKey({ name: extractCustomEmojiName(emoji), host: extractCustomEmojiHost(emoji) }) : emoji; - const mutedEmojis = prefer.s.mutingEmojis; - return prefer.commit('mutingEmojis', mutedEmojis.filter((e) => e !== emojiMuteKey)); + const mutedEmojis = prefer.r.mutingEmojis.value; + console.log('unmute', emoji, emojiMuteKey); + console.log('mutedEmojis', mutedEmojis); + prefer.commit('mutingEmojis', mutedEmojis.filter((e) => e !== emojiMuteKey)); } export function checkMuted(emoji: string) { @@ -57,5 +57,5 @@ export function checkMuted(emoji: string) { const emojiMuteKey = isCustomEmoji ? makeEmojiMuteKey({ name: extractCustomEmojiName(emoji), host: extractCustomEmojiHost(emoji) }) : emoji; - return computed(() => prefer.s.mutingEmojis.includes(emojiMuteKey)); + return computed(() => prefer.r.mutingEmojis.value.includes(emojiMuteKey)); }