浏览代码

Небольшое улучшение

Book Pauk 2 年之前
父节点
当前提交
f582c34a72
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      client/components/Search/Search.vue

+ 9 - 1
client/components/Search/Search.vue

@@ -188,8 +188,10 @@ const componentOptions = {
         DivBtn
         DivBtn
     },
     },
     watch: {
     watch: {
-        config() {
+        config(newValue) {
             this.makeProjectName();
             this.makeProjectName();
+            if (newValue.dbConfig)
+                this.list.inpxHash = newValue.dbConfig.inpxHash;
         },
         },
         settings() {
         settings() {
             this.loadSettings();
             this.loadSettings();
@@ -718,6 +720,10 @@ class Search {
     }
     }
 
 
     async updateGenreTreeIfNeeded() {
     async updateGenreTreeIfNeeded() {
+        if (this.genreTreeUpdating)
+            return;
+        
+        this.genreTreeUpdating = true;
         try {
         try {
             if (this.genreTreeInpxHash !== this.list.inpxHash) {
             if (this.genreTreeInpxHash !== this.list.inpxHash) {
                 let result;
                 let result;
@@ -748,6 +754,8 @@ class Search {
             }
             }
         } catch (e) {
         } catch (e) {
             this.$root.stdDialog.alert(e.message, 'Ошибка');
             this.$root.stdDialog.alert(e.message, 'Ошибка');
+        } finally {
+            this.genreTreeUpdating = false;
         }
         }
     }
     }
 }
 }