diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c1d49f2e5464118b35cbf5a7c34c55081af9244..dfb09b606187817b10befc768c9c5a7d2ef07b46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ You should also include the user name that made the change. - Client: リアクションピッカーã®é«˜ã•ãŒä½Žããªã£ãŸã¾ã¾æˆ»ã‚‰ãªã„ã“ã¨ãŒã‚ã‚‹ã®ã‚’ä¿®æ£ @syuilo - Client: ユーザーåオートコンプリートãŒæ£ã—ã動作ã—ãªã„å•é¡Œã‚’ä¿®æ£ @syuilo - Client: タッãƒæ“作ã ã¨ã‚¦ã‚£ã‚¸ã‚§ãƒƒãƒˆã®ç·¨é›†ãŒã—ã«ãã„ã®ã‚’ä¿®æ£ @xianonn +- Client: register_note_view_interruptor()ãŒå‹•ã‹ãªã„ã®ã‚’ä¿®æ£ @syuilo ## 12.107.0 (2022/02/12) diff --git a/packages/client/src/components/note.vue b/packages/client/src/components/note.vue index 93286a28b251bcb1b6f92b76a22cef65c0bd87ec..3cd7a819d4a7184f105b865ddeb78b97597abdad 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 && (