From b938c6764ac2c99294ab667da667c945a4ef1299 Mon Sep 17 00:00:00 2001
From: Eva Bardou <ebardou@teklia.com>
Date: Fri, 2 Jul 2021 12:39:33 +0200
Subject: [PATCH] Rename store mutations

---
 src/components/KeyboardConfiguration.vue |  6 +++---
 src/components/KeyboardManager.vue       | 12 ++++++------
 src/store/index.js                       |  8 ++++----
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/components/KeyboardConfiguration.vue b/src/components/KeyboardConfiguration.vue
index ccd4fae0..a719f797 100644
--- a/src/components/KeyboardConfiguration.vue
+++ b/src/components/KeyboardConfiguration.vue
@@ -77,11 +77,11 @@ export default {
     displayUTF8,
   },
   methods: {
-    ...mapMutations(["updateKey"]),
+    ...mapMutations(["updateKeyboardKey"]),
     replace() {
       if (!this.selectedKey || !this.selectedChar) return;
       // Update the keyboard
-      this.updateKey({
+      this.updateKeyboardKey({
         index: this.keyboardIndex,
         ...this.selectedKey,
         character: displayUTF8(this.selectedChar.code),
@@ -91,7 +91,7 @@ export default {
       this.picker = false;
     },
     updateKeyBinding() {
-      this.updateKey({
+      this.updateKeyboardKey({
         index: this.keyboardIndex,
         ...this.selectedKey,
         keyboard_code: this.keyBinding ? this.keyBinding.charCodeAt() : null,
diff --git a/src/components/KeyboardManager.vue b/src/components/KeyboardManager.vue
index 29774fea..74eeec59 100644
--- a/src/components/KeyboardManager.vue
+++ b/src/components/KeyboardManager.vue
@@ -5,7 +5,7 @@
         ⏴
       </a>
       <input type="text" v-model="keyboardName" />
-      <button type="button" v-on:click="updateKeyboardName">Save</button>
+      <button type="button" v-on:click="changeKeyboardName">Save</button>
       <KeyboardConfiguration :keyboard-index="editedKeyboard" />
     </div>
     <div v-else-if="selectedKeyboard !== null">
@@ -104,18 +104,18 @@ export default {
     ...mapState(["keyboards"]),
   },
   methods: {
-    ...mapMutations(["add", "delete", "updateName"]),
-    updateKeyboardName() {
-      this.updateName({
+    ...mapMutations(["addKeyboard", "removeKeyboard", "updateKeyboardName"]),
+    changeKeyboardName() {
+      this.updateKeyboardName({
         index: this.editedKeyboard,
         name: this.keyboardName,
       });
     },
     createKeyboard() {
-      this.add();
+      this.addKeyboard();
     },
     deleteKeyboard() {
-      this.delete(this.keyboardToDelete);
+      this.removeKeyboard(this.keyboardToDelete);
       this.keyboardToDelete = null;
       this.deleteModal = false;
     },
diff --git a/src/store/index.js b/src/store/index.js
index be0b54d8..0ea2d4bb 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -44,17 +44,17 @@ export default new Vuex.Store({
     setSelectedScript(state, { name, page }) {
       state.selectedScript = { name, page };
     },
-    add(state) {
+    addKeyboard(state) {
       state.keyboards = [...state.keyboards, { ...NEW_KEYBOARD }];
     },
-    delete(state, index) {
+    removeKeyboard(state, index) {
       state.keyboards.splice(index, 1);
     },
-    updateName(state, { index, name }) {
+    updateKeyboardName(state, { index, name }) {
       if (!state.keyboards[index]) return;
       state.keyboards[index].name = name;
     },
-    updateKey(state, { index, ...newKey }) {
+    updateKeyboardKey(state, { index, ...newKey }) {
       // Copy the keyboard if the index is correct to avoid modifying it directly in the state
       const keyboard = state.keyboards[index] && { ...state.keyboards[index] };
       if (!keyboard) return;
-- 
GitLab