From 30df8ea1213013072f139aa26a635330457cf2bc Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 29 Jul 2020 01:15:02 +0900 Subject: feat(client): AiScript: ノート書き換えAPI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/store.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/client/store.ts') diff --git a/src/client/store.ts b/src/client/store.ts index 67dd6ea06a..7046e10f98 100644 --- a/src/client/store.ts +++ b/src/client/store.ts @@ -111,6 +111,7 @@ export default () => new Vuex.Store({ postFormActions: [], userActions: [], noteActions: [], + noteViewInterruptors: [], }, getters: { @@ -274,6 +275,14 @@ export default () => new Vuex.Store({ } }); }, + + registerNoteViewInterruptor(state, { pluginId, handler }) { + state.noteViewInterruptors.push({ + handler: (note) => { + return state.pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(note)]); + } + }); + }, }, actions: { -- cgit v1.3.1-freya