feat(client): Plugin:register_note_post_interruptor API

This commit is contained in:
syuilo
2020-07-29 23:37:50 +09:00
parent 60d81d74e3
commit e7de5f6051
3 changed files with 26 additions and 4 deletions

View File

@@ -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: {