|
@@ -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) {
|