From 9a415f9826382394b32b41e0e312d952f71db1d3 Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 19 Oct 2023 14:39:41 +0900 Subject: [PATCH] fix: properly bypass word mute check if signed out --- packages/client/src/components/MkNote.vue | 2 +- packages/client/src/components/MkNoteDetailed.vue | 2 +- packages/client/src/components/MkNoteSub.vue | 2 +- packages/client/src/scripts/check-word-mute.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/client/src/components/MkNote.vue b/packages/client/src/components/MkNote.vue index 320ab6be..3a8c2a62 100644 --- a/packages/client/src/components/MkNote.vue +++ b/packages/client/src/components/MkNote.vue @@ -359,7 +359,7 @@ const isDeleted = ref(false); const muted = ref( getWordSoftMute( note.value, - $i.id, + $i?.id, defaultStore.state.mutedWords, defaultStore.state.mutedLangs, ), diff --git a/packages/client/src/components/MkNoteDetailed.vue b/packages/client/src/components/MkNoteDetailed.vue index 873199c9..ab596f34 100644 --- a/packages/client/src/components/MkNoteDetailed.vue +++ b/packages/client/src/components/MkNoteDetailed.vue @@ -234,7 +234,7 @@ const isDeleted = ref(false); const muted = ref( getWordSoftMute( note.value, - $i.id, + $i?.id, defaultStore.state.mutedWords, defaultStore.state.mutedLangs, ), diff --git a/packages/client/src/components/MkNoteSub.vue b/packages/client/src/components/MkNoteSub.vue index 1a8a665d..842bcae7 100644 --- a/packages/client/src/components/MkNoteSub.vue +++ b/packages/client/src/components/MkNoteSub.vue @@ -268,7 +268,7 @@ const isDeleted = ref(false); const muted = ref( getWordSoftMute( note.value, - $i.id, + $i?.id, defaultStore.state.mutedWords, defaultStore.state.mutedLangs, ), diff --git a/packages/client/src/scripts/check-word-mute.ts b/packages/client/src/scripts/check-word-mute.ts index 7bdf6a96..730351c5 100644 --- a/packages/client/src/scripts/check-word-mute.ts +++ b/packages/client/src/scripts/check-word-mute.ts @@ -79,7 +79,7 @@ export function getWordSoftMute( mutedWords: Array, mutedLangs: Array, ): Muted { - if (note.userId === meId) return NotMuted; + if (meId == null || note.userId === meId) return NotMuted; if (mutedWords.length > 0) { const noteMuted = checkWordMute(note, mutedWords);