Browse Source

Resolve "Glitch in configuration logic"

Drew McArthur 1 year ago
parent
commit
0f1e51dbdf
1 changed files with 9 additions and 7 deletions
  1. 9 7
      assets/js/vue.rules.js

+ 9 - 7
assets/js/vue.rules.js

@@ -594,13 +594,10 @@ const app = Vue.createApp({
        * Add custom config entry to the module
        * Add custom config entry to the module
        */
        */
       addConfig() {
       addConfig() {
-          const k = document.getElementById("newConfigKey").value;
-          const v = document.getElementById("newConfigValue").value;
-          this.editor.module.config[k] = v;
-          document.getElementById("newConfigKey").value =
-              "Configuration";
-          document.getElementById("newConfigValue").value =
-              "Value";
+        const k = document.getElementById("newConfigKey").value;
+        const v = document.getElementById("newConfigValue").value;
+        this.editor.module.config[k] = v;
+        this.resetNewConfigInputs();
       },
       },
       
       
       /**
       /**
@@ -629,8 +626,13 @@ const app = Vue.createApp({
       const module = this.newModule();
       const module = this.newModule();
       module.name = 'New Module';
       module.name = 'New Module';
       module.config = {};
       module.config = {};
+      this.resetNewConfigInputs();
       this.addToEditor(module);
       this.addToEditor(module);
     },
     },
+    resetNewConfigInputs() {
+      document.getElementById("newConfigKey").value = "Configuration";
+      document.getElementById("newConfigValue").value = "Value";
+    },
     /**
     /**
      * Removes a module from the customModules array
      * Removes a module from the customModules array
      * @param {Object} module the module to remove from the customModules array
      * @param {Object} module the module to remove from the customModules array