diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-07-18 14:28:32 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-07-18 14:28:32 +0900 |
| commit | b39850de012fa7b05959c7f4bbbbade841d186ff (patch) | |
| tree | f726b3b0d3125e1473d5e800e13fd26dffe1987c /src/client/store.ts | |
| parent | fix(docs): Update api doc (diff) | |
| download | sharkey-b39850de012fa7b05959c7f4bbbbade841d186ff.tar.gz sharkey-b39850de012fa7b05959c7f4bbbbade841d186ff.tar.bz2 sharkey-b39850de012fa7b05959c7f4bbbbade841d186ff.zip | |
feat(client): AiScriptプラグインからAPIアクセスできるように
Diffstat (limited to 'src/client/store.ts')
| -rw-r--r-- | src/client/store.ts | 14 |
1 files changed, 8 insertions, 6 deletions
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; + }, } }, |