diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-07-29 23:37:50 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-07-29 23:37:50 +0900 |
| commit | e7de5f60513774e9c599a2e3aac0fbeefb88236f (patch) | |
| tree | 3412fa4ac5af01ed242febbc904bebe1744fffaf /src/client/store.ts | |
| parent | feat(client): AiScript: Plugin:open_url function (diff) | |
| download | misskey-e7de5f60513774e9c599a2e3aac0fbeefb88236f.tar.gz misskey-e7de5f60513774e9c599a2e3aac0fbeefb88236f.tar.bz2 misskey-e7de5f60513774e9c599a2e3aac0fbeefb88236f.zip | |
feat(client): Plugin:register_note_post_interruptor API
Diffstat (limited to 'src/client/store.ts')
| -rw-r--r-- | src/client/store.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/client/store.ts b/src/client/store.ts index 7046e10f98..0e16115903 100644 --- a/src/client/store.ts +++ b/src/client/store.ts @@ -112,6 +112,7 @@ export default () => new Vuex.Store({ userActions: [], noteActions: [], noteViewInterruptors: [], + notePostInterruptors: [], }, getters: { @@ -283,6 +284,14 @@ export default () => new Vuex.Store({ } }); }, + + registerNotePostInterruptor(state, { pluginId, handler }) { + state.notePostInterruptors.push({ + handler: (note) => { + return state.pluginContexts.get(pluginId).execFn(handler, [utils.jsToVal(note)]); + } + }); + }, }, actions: { |