浏览代码

Мелкая поправка

Book Pauk 6 年之前
父节点
当前提交
015254ae40
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      client/components/Reader/ServerStorage/ServerStorage.vue

+ 5 - 1
client/components/Reader/ServerStorage/ServerStorage.vue

@@ -21,7 +21,7 @@ export default @Component({
             this.serverStorageKeyChanged();
         },
         settings: function() {
-            this.saveSettings();
+            this.debouncedSaveSettings();
         },
         profiles: function() {
             this.saveProfiles();
@@ -37,6 +37,10 @@ class ServerStorage extends Vue {
         this.prevServerStorageKey = null;
         this.$root.$on('generateNewServerStorageKey', () => {this.generateNewServerStorageKey()});
 
+        this.debouncedSaveSettings = _.debounce(() => {
+            this.saveSettings();
+        }, 500);
+
         this.oldProfiles = {};
         this.oldSettings = {};
     }