diff --git a/src/application/worker/store/modules/inputs.js b/src/application/worker/store/modules/inputs.js index dd9b1a485..66b4e3317 100644 --- a/src/application/worker/store/modules/inputs.js +++ b/src/application/worker/store/modules/inputs.js @@ -21,6 +21,10 @@ const actions = { commit("SET_FOCUSED_INPUT", { id, title, writeToSwap }); }, + clearFocusedInput({ commit }) { + commit("SET_FOCUSED_INPUT", { id: null, title: null }); + }, + addInput({ commit }, { type, location, data, id = uuidv4(), writeToSwap }) { const input = { type, location, data, id }; commit("ADD_INPUT", { input, writeToSwap }); diff --git a/src/components/ActiveModule.vue b/src/components/ActiveModule.vue index ad8fb7b9b..9db338ab0 100644 --- a/src/components/ActiveModule.vue +++ b/src/components/ActiveModule.vue @@ -205,9 +205,11 @@ export default { return this.$modV.store.state.inputs.focusedInput.id === id; }, - removeModule(e) { + async removeModule(e) { if (e.keyCode === 8 || e.keyCode === 46) { this.$store.commit("ui-modules/SET_FOCUSED", null); + await this.$modV.store.dispatch("inputs/clearFocusedInput"); + this.$emit("remove-module", this.id); } }