From b39850de012fa7b05959c7f4bbbbade841d186ff Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Jul 2020 14:28:32 +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 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/client/store.ts') diff --git a/src/client/store.ts b/src/client/store.ts index c7b8e84e9d..2cd2c8cf3c 100644 --- a/src/client/store.ts +++ b/src/client/store.ts @@ -587,13 +587,11 @@ export default () => new Vuex.Store({ }, //#endregion - installPlugin(state, { meta, ast }) { + installPlugin(state, { meta, ast, token }) { state.plugins.push({ - id: meta.id, - name: meta.name, - version: meta.version, - author: meta.author, - description: meta.description, + ...meta, + configData: {}, + token: token, ast: ast }); }, @@ -601,6 +599,10 @@ export default () => new Vuex.Store({ uninstallPlugin(state, id) { state.plugins = state.plugins.filter(x => x.id != id); }, + + configPlugin(state, { id, config }) { + state.plugins.find(p => p.id === id).configData = config; + }, } }, -- cgit v1.2.3-freya