Procházet zdrojové kódy

Merge branch 'release/1.1.0-1'

Book Pauk před 2 roky
rodič
revize
be36f8f6e8

+ 12 - 0
client/components/ExternalLibs/ExternalLibs.vue

@@ -312,6 +312,7 @@ class ExternalLibs {
     inpxUrl = '';
 
     created() {
+        this.commit = this.$store.commit;
         this.oldStartLink = '';
         this.justOpened = true;
         this.$root.addEventHook('key', this.keyHook);
@@ -404,6 +405,8 @@ class ExternalLibs {
             this.ready = true;
             if (d.data)
                 this.libs = _.cloneDeep(d.data);
+            if (d.sets)
+                this.updateSets(d.sets);
         } else if (d.type == 'notify') {
             this.$root.notify.success(d.data, '', {position: 'bottom-right'});
         }
@@ -448,6 +451,11 @@ class ExternalLibs {
         }
     }
 
+    updateSets(sets) {
+        if (sets.nightMode !== this.nightMode)
+            this.commit('reader/nightModeToggle');
+    }
+
     commitLibs(libs) {
         this.sendMessage({type: 'libs', data: libs});
     }
@@ -496,6 +504,10 @@ class ExternalLibs {
         return this.$store.state.config.mode;
     }
 
+    get nightMode() {
+        return this.$store.state.reader.settings.nightMode;
+    }
+
     get header() {
         let result = [this.ready ? 'Сетевая библиотека' : 'Загрузка...'];
         if (this.ready && this.selectedLink) {

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

@@ -119,8 +119,12 @@ class LibsPage {
         return this.$store.state.reader.libs;
     }
 
+    get nightMode() {
+        return this.$store.state.reader.settings.nightMode;
+    }
+
     sendLibs() {
-        this.sendMessage({type: 'libs', data: _.cloneDeep(this.libs)});
+        this.sendMessage({type: 'libs', data: _.cloneDeep(this.libs), sets: {nightMode: this.nightMode}});
     }
 
     close() {