diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-03-09 21:23:36 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-03-09 21:23:36 +0900 |
| commit | 0402866b4378e014943cb03031953e07bd082a35 (patch) | |
| tree | 54ae6bcd9d50b1746da2f8b345b7e51f96edc28b /packages/frontend/src/components | |
| parent | chore(frontend): remove unused binding (diff) | |
| download | misskey-0402866b4378e014943cb03031953e07bd082a35.tar.gz misskey-0402866b4378e014943cb03031953e07bd082a35.tar.bz2 misskey-0402866b4378e014943cb03031953e07bd082a35.zip | |
enhance(frontend): improve plugin management
Diffstat (limited to 'packages/frontend/src/components')
| -rw-r--r-- | packages/frontend/src/components/MkNote.vue | 3 | ||||
| -rw-r--r-- | packages/frontend/src/components/MkNoteDetailed.vue | 3 | ||||
| -rw-r--r-- | packages/frontend/src/components/MkPostForm.vue | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index f3f8c1ce82..ca778d87de 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -222,7 +222,7 @@ import { isEnabledUrlPreview } from '@/instance.js'; import { focusPrev, focusNext } from '@/utility/focus.js'; import { getAppearNote } from '@/utility/get-appear-note.js'; import { prefer } from '@/preferences.js'; -import { noteViewInterruptors } from '@/plugin.js'; +import { getPluginHandlers } from '@/plugin.js'; const props = withDefaults(defineProps<{ note: Misskey.entities.Note; @@ -248,6 +248,7 @@ const currentClip = inject<Ref<Misskey.entities.Clip> | null>('currentClip', nul const note = ref(deepClone(props.note)); // plugin +const noteViewInterruptors = getPluginHandlers('note_view_interruptor'); if (noteViewInterruptors.length > 0) { onMounted(async () => { let result: Misskey.entities.Note | null = deepClone(note.value); diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue index 7f982858f1..3f3dbf6d83 100644 --- a/packages/frontend/src/components/MkNoteDetailed.vue +++ b/packages/frontend/src/components/MkNoteDetailed.vue @@ -254,7 +254,7 @@ import MkButton from '@/components/MkButton.vue'; import { isEnabledUrlPreview } from '@/instance.js'; import { getAppearNote } from '@/utility/get-appear-note.js'; import { prefer } from '@/preferences.js'; -import { noteViewInterruptors } from '@/plugin.js'; +import { getPluginHandlers } from '@/plugin.js'; const props = withDefaults(defineProps<{ note: Misskey.entities.Note; @@ -268,6 +268,7 @@ const inChannel = inject('inChannel', null); const note = ref(deepClone(props.note)); // plugin +const noteViewInterruptors = getPluginHandlers('note_view_interruptor'); if (noteViewInterruptors.length > 0) { onMounted(async () => { let result: Misskey.entities.Note | null = deepClone(note.value); diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 4edb147b86..755e13279c 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -136,7 +136,7 @@ import { claimAchievement } from '@/utility/achievements.js'; import { emojiPicker } from '@/utility/emoji-picker.js'; import { mfmFunctionPicker } from '@/utility/mfm-function-picker.js'; import { prefer } from '@/preferences.js'; -import { notePostInterruptors, postFormActions } from '@/plugin.js'; +import { getPluginHandlers } from '@/plugin.js'; const $i = signinRequired(); @@ -197,6 +197,7 @@ const showingOptions = ref(false); const textAreaReadOnly = ref(false); const justEndedComposition = ref(false); const renoteTargetNote: ShallowRef<PostFormProps['renote'] | null> = shallowRef(props.renote); +const postFormActions = getPluginHandlers('post_form_action'); const draftKey = computed((): string => { let key = props.channel ? `channel:${props.channel.id}` : ''; @@ -823,6 +824,7 @@ async function post(ev?: MouseEvent) { } // plugin + const notePostInterruptors = getPluginHandlers('note_post_interruptor'); if (notePostInterruptors.length > 0) { for (const interruptor of notePostInterruptors) { try { |