diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-03-05 01:22:57 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2022-03-05 01:22:57 +0900 |
| commit | 476dfb0f351c9b879de90fe3d1aef826ab03b82b (patch) | |
| tree | 255a8ea5447be812072571d3c32137bf075be511 /packages/client/src/components | |
| parent | chore(client): hide error report setting (diff) | |
| download | misskey-476dfb0f351c9b879de90fe3d1aef826ab03b82b.tar.gz misskey-476dfb0f351c9b879de90fe3d1aef826ab03b82b.tar.bz2 misskey-476dfb0f351c9b879de90fe3d1aef826ab03b82b.zip | |
fix(client): register_note_view_interruptor()が動かないのを修正
Fix #8318
Diffstat (limited to 'packages/client/src/components')
| -rw-r--r-- | packages/client/src/components/note.vue | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/packages/client/src/components/note.vue b/packages/client/src/components/note.vue index 93286a28b2..3cd7a819d4 100644 --- a/packages/client/src/components/note.vue +++ b/packages/client/src/components/note.vue @@ -138,7 +138,18 @@ const props = defineProps<{ const inChannel = inject('inChannel', null); -const note = $ref(JSON.parse(JSON.stringify(props.note))); +let note = $ref(JSON.parse(JSON.stringify(props.note))); + +// plugin +if (noteViewInterruptors.length > 0) { + onMounted(async () => { + let result = JSON.parse(JSON.stringify(note)); + for (const interruptor of noteViewInterruptors) { + result = await interruptor.handler(result); + } + note = result; + }); +} const isRenote = ( note.renote != null && @@ -152,7 +163,7 @@ const menuButton = ref<HTMLElement>(); const renoteButton = ref<InstanceType<typeof XRenoteButton>>(); const renoteTime = ref<HTMLElement>(); const reactButton = ref<HTMLElement>(); -let appearNote = $ref(isRenote ? note.renote as misskey.entities.Note : note); +let appearNote = $computed(() => isRenote ? note.renote as misskey.entities.Note : note); const isMyRenote = $i && ($i.id === note.userId); const showContent = ref(false); const collapsed = ref(appearNote.cw == null && appearNote.text != null && ( |