Skip to content
Snippets Groups Projects
Commit 57203de4 authored by syuilo's avatar syuilo
Browse files

feat(client): プラグインのIDを不要に

parent 74d0e83a
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,7 @@
import Vue from 'vue';
import { AiScript, parse } from '@syuilo/aiscript';
import { serialize } from '@syuilo/aiscript/built/serializer';
import { v4 as uuid } from 'uuid';
import { faPlug, faSave, faTrashAlt, faFolderOpen, faDownload, faCog } from '@fortawesome/free-solid-svg-icons';
import MkButton from '../../components/ui/button.vue';
import MkTextarea from '../../components/ui/textarea.vue';
......@@ -106,8 +107,8 @@ export default Vue.extend({
});
return;
}
const { id, name, version, author, description, permissions, config } = data;
if (id == null || name == null || version == null || author == null) {
const { name, version, author, description, permissions, config } = data;
if (name == null || version == null || author == null) {
this.$root.dialog({
type: 'error',
text: 'Required property not found :('
......@@ -133,8 +134,9 @@ export default Vue.extend({
});
this.$store.commit('deviceUser/installPlugin', {
id: uuid(),
meta: {
id, name, version, author, description, permissions, config
name, version, author, description, permissions, config
},
token,
ast: serialize(ast)
......
......@@ -613,9 +613,10 @@ export default () => new Vuex.Store({
},
//#endregion
installPlugin(state, { meta, ast, token }) {
installPlugin(state, { id, meta, ast, token }) {
state.plugins.push({
...meta,
id,
active: true,
configData: {},
token: token,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment