From a0db3c9154c3e63ae943982de273615b6893c3b2 Mon Sep 17 00:00:00 2001 From: Sam Wray Date: Thu, 1 Jul 2021 21:34:21 +0100 Subject: [PATCH 1/6] fix: updates a group's outputContext name when group's name is updated (#604) * fix: updates a group's outputContext name when group's name is updated Adds new store methods for auxillary outputContexts and updating a group name fixes #599 * fix: removes accidental code committed from a different feature branch * fix: removes accidental code committed from a different feature branch --- .../worker/store/modules/groups.js | 18 ++++ .../worker/store/modules/outputs.js | 12 +++ src/components/Group.vue | 84 +------------------ 3 files changed, 33 insertions(+), 81 deletions(-) diff --git a/src/application/worker/store/modules/groups.js b/src/application/worker/store/modules/groups.js index c889b1d0e..7ec5bf8e7 100644 --- a/src/application/worker/store/modules/groups.js +++ b/src/application/worker/store/modules/groups.js @@ -194,6 +194,24 @@ const actions = { }); }, + updateGroupName({ commit }, { groupId, name }) { + const group = state.groups.find(group => group.id === groupId); + + store.commit("outputs/UPDATE_AUXILLARY", { + auxillaryId: group.context.id, + data: { + name + } + }); + + commit("UPDATE_GROUP", { + groupId, + data: { + name + } + }); + }, + async loadPresetData({ dispatch }, groups) { for (let i = 0, len = groups.length; i < len; i++) { const group = groups[i]; diff --git a/src/application/worker/store/modules/outputs.js b/src/application/worker/store/modules/outputs.js index 1b47eb854..0a5185feb 100644 --- a/src/application/worker/store/modules/outputs.js +++ b/src/application/worker/store/modules/outputs.js @@ -127,6 +127,18 @@ const mutations = { Vue.delete(state.auxillary, id); }, + UPDATE_AUXILLARY(state, { auxillaryId, data }) { + if (state.auxillary[auxillaryId]) { + const dataKeys = Object.keys(data); + const dataKeysLength = dataKeys.length; + for (let i = 0; i < dataKeysLength; i += 1) { + const key = dataKeys[i]; + const value = data[key]; + state.auxillary[auxillaryId][key] = value; + } + } + }, + RESIZE_MAIN_OUTPUT(state, { width, height }) { if (!state.main.canvas) { return; diff --git a/src/components/Group.vue b/src/components/Group.vue index 9049df73e..5e5ff2fcd 100644 --- a/src/components/Group.vue +++ b/src/components/Group.vue @@ -199,87 +199,11 @@ - - diff --git a/src/components/ModuleInspector.vue b/src/components/ModuleInspector.vue index b5357cf88..04b2a0359 100644 --- a/src/components/ModuleInspector.vue +++ b/src/components/ModuleInspector.vue @@ -9,7 +9,7 @@
{{ module.meta.name }}
- diff --git a/src/components/Plugins.vue b/src/components/Plugins.vue new file mode 100644 index 000000000..7aa53acdd --- /dev/null +++ b/src/components/Plugins.vue @@ -0,0 +1,89 @@ + + + + +