diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2025-12-13 19:08:02 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-13 19:08:02 +0900 |
| commit | 36d404818da975151b684874598d40d18ee302a4 (patch) | |
| tree | 4078eddcddbe49aa8bacbd99686655432590d1db | |
| parent | fix(frontend): follow-up of 16970 (#16975) (diff) | |
| download | misskey-36d404818da975151b684874598d40d18ee302a4.tar.gz misskey-36d404818da975151b684874598d40d18ee302a4.tar.bz2 misskey-36d404818da975151b684874598d40d18ee302a4.zip | |
fix(frontend/aiscript): nullを返すnote_view_intrruptorが動作しない問題を修正 (#16977)
* fix(frontend/aiscript): nullを返すnote_view_intrruptorが動作しない問題を修正
* Update Changelog
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | packages/frontend/src/components/MkNote.vue | 11 | ||||
| -rw-r--r-- | packages/frontend/src/components/MkNoteDetailed.vue | 9 |
3 files changed, 16 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ae71498b7..58c6c1cfd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Fix: 削除されたノートのリノートが正しく動作されない問題を修正 - Fix: チャンネルオーナーが削除済みの時にチャンネルのヘッダーメニューが表示されない不具合を修正 - Fix: ドライブで登録日以外でソートする場合は月でグループ化して表示しないように +- Fix: `null` を返す note_view_intrruptor プラグインが動作しない問題を修正 ### Server - Fix: ジョブキューでSentryが有効にならない問題を修正 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); |