Skip to content

Commit 36d4048

Browse files
fix(frontend/aiscript): nullを返すnote_view_intrruptorが動作しない問題を修正 (#16977)
* fix(frontend/aiscript): nullを返すnote_view_intrruptorが動作しない問題を修正 * Update Changelog
1 parent cb03f3f commit 36d4048

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- Fix: 削除されたノートのリノートが正しく動作されない問題を修正
1010
- Fix: チャンネルオーナーが削除済みの時にチャンネルのヘッダーメニューが表示されない不具合を修正
1111
- Fix: ドライブで登録日以外でソートする場合は月でグループ化して表示しないように
12+
- Fix: `null` を返す note_view_intrruptor プラグインが動作しない問題を修正
1213

1314
### Server
1415
- Fix: ジョブキューでSentryが有効にならない問題を修正

packages/frontend/src/components/MkNote.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
55

66
<template>
77
<div
8-
v-if="!hardMuted && muted === false"
8+
v-if="!hardMuted && !hideByPlugin && muted === false"
99
ref="rootEl"
1010
v-hotkey="keymap"
1111
:class="[$style.root, { [$style.showActionsOnlyHover]: prefer.s.showNoteActionsOnlyHover, [$style.skipRender]: prefer.s.skipNoteRender }]"
@@ -161,7 +161,7 @@ SPDX-License-Identifier: AGPL-3.0-only
161161
</div>
162162
</article>
163163
</div>
164-
<div v-else-if="!hardMuted" :class="$style.muted" @click="muted = false">
164+
<div v-else-if="!hardMuted && !hideByPlugin" :class="$style.muted" @click="muted = false">
165165
<I18n v-if="muted === 'sensitiveMute'" :src="i18n.ts.userSaysSomethingSensitive" tag="small">
166166
<template #name>
167167
<MkA v-user-preview="appearNote.userId" :to="userPage(appearNote.user)">
@@ -270,6 +270,7 @@ let note = deepClone(props.note);
270270
271271
// plugin
272272
const noteViewInterruptors = getPluginHandlers('note_view_interruptor');
273+
const hideByPlugin = ref(false);
273274
if (noteViewInterruptors.length > 0) {
274275
let result: Misskey.entities.Note | null = deepClone(note);
275276
for (const interruptor of noteViewInterruptors) {
@@ -279,7 +280,11 @@ if (noteViewInterruptors.length > 0) {
279280
console.error(err);
280281
}
281282
}
282-
note = result as Misskey.entities.Note;
283+
if (result == null) {
284+
hideByPlugin.value = true;
285+
} else {
286+
note = result as Misskey.entities.Note;
287+
}
283288
}
284289
285290
const isRenote = Misskey.note.isPureRenote(note);

packages/frontend/src/components/MkNoteDetailed.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
55

66
<template>
77
<div
8-
v-if="!muted && !isDeleted"
8+
v-if="!muted && !hideByPlugin && !isDeleted"
99
ref="rootEl"
1010
v-hotkey="keymap"
1111
:class="$style.root"
@@ -294,6 +294,7 @@ let note = deepClone(props.note);
294294
295295
// plugin
296296
const noteViewInterruptors = getPluginHandlers('note_view_interruptor');
297+
const hideByPlugin = ref(false);
297298
if (noteViewInterruptors.length > 0) {
298299
let result: Misskey.entities.Note | null = deepClone(note);
299300
for (const interruptor of noteViewInterruptors) {
@@ -303,7 +304,11 @@ if (noteViewInterruptors.length > 0) {
303304
console.error(err);
304305
}
305306
}
306-
note = result as Misskey.entities.Note;
307+
if (result == null) {
308+
hideByPlugin.value = true;
309+
} else {
310+
note = result as Misskey.entities.Note;
311+
}
307312
}
308313
309314
const isRenote = Misskey.note.isPureRenote(note);

0 commit comments

Comments
 (0)