summaryrefslogtreecommitdiff
path: root/src/client/store.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2020-07-18 14:28:32 +0900
committersyuilo <syuilotan@yahoo.co.jp>2020-07-18 14:28:32 +0900
commitb39850de012fa7b05959c7f4bbbbade841d186ff (patch)
treef726b3b0d3125e1473d5e800e13fd26dffe1987c /src/client/store.ts
parentfix(docs): Update api doc (diff)
downloadsharkey-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.ts14
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;
+ },
}
},