From fd3d788aad51145f4e7f1aecbe2e56ad4800b9a1 Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 19 Oct 2023 14:41:16 +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 7463d32f96..7a63f9012e 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 5e0770e151..a2e9c10db8 100644 --- a/packages/client/src/components/MkNoteDetailed.vue +++ b/packages/client/src/components/MkNoteDetailed.vue @@ -235,7 +235,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 535320079d..1dd1351700 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 7bdf6a9685..730351c590 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);