diff options
Diffstat (limited to 'packages/frontend/src/components')
| -rw-r--r-- | packages/frontend/src/components/MkNote.vue | 11 | ||||
| -rw-r--r-- | packages/frontend/src/components/MkNoteDetailed.vue | 9 |
2 files changed, 15 insertions, 5 deletions
diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index e09c5220ad..a7299d2961 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only <template> <div - v-if="!hardMuted && muted === false" + v-if="!hardMuted && !hideByPlugin && muted === false" ref="rootEl" v-hotkey="keymap" :class="[$style.root, { [$style.showActionsOnlyHover]: prefer.s.showNoteActionsOnlyHover, [$style.skipRender]: prefer.s.skipNoteRender }]" @@ -161,7 +161,7 @@ SPDX-License-Identifier: AGPL-3.0-only </div> </article> </div> -<div v-else-if="!hardMuted" :class="$style.muted" @click="muted = false"> +<div v-else-if="!hardMuted && !hideByPlugin" :class="$style.muted" @click="muted = false"> <I18n v-if="muted === 'sensitiveMute'" :src="i18n.ts.userSaysSomethingSensitive" tag="small"> <template #name> <MkA v-user-preview="appearNote.userId" :to="userPage(appearNote.user)"> @@ -270,6 +270,7 @@ let note = deepClone(props.note); // plugin const noteViewInterruptors = getPluginHandlers('note_view_interruptor'); +const hideByPlugin = ref(false); if (noteViewInterruptors.length > 0) { let result: Misskey.entities.Note | null = deepClone(note); for (const interruptor of noteViewInterruptors) { @@ -279,7 +280,11 @@ if (noteViewInterruptors.length > 0) { console.error(err); } } - note = result as Misskey.entities.Note; + if (result == null) { + hideByPlugin.value = true; + } else { + note = result as Misskey.entities.Note; + } } const isRenote = Misskey.note.isPureRenote(note); diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue index 825133d482..47bf365877 100644 --- a/packages/frontend/src/components/MkNoteDetailed.vue +++ b/packages/frontend/src/components/MkNoteDetailed.vue @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only <template> <div - v-if="!muted && !isDeleted" + v-if="!muted && !hideByPlugin && !isDeleted" ref="rootEl" v-hotkey="keymap" :class="$style.root" @@ -294,6 +294,7 @@ let note = deepClone(props.note); // plugin const noteViewInterruptors = getPluginHandlers('note_view_interruptor'); +const hideByPlugin = ref(false); if (noteViewInterruptors.length > 0) { let result: Misskey.entities.Note | null = deepClone(note); for (const interruptor of noteViewInterruptors) { @@ -303,7 +304,11 @@ if (noteViewInterruptors.length > 0) { console.error(err); } } - note = result as Misskey.entities.Note; + if (result == null) { + hideByPlugin.value = true; + } else { + note = result as Misskey.entities.Note; + } } const isRenote = Misskey.note.isPureRenote(note); |