Работа над ServerStorage

This commit is contained in:
Book Pauk
2019-03-17 19:41:47 +07:00
parent 58941116c8
commit 2a4ff926ae
3 changed files with 53 additions and 17 deletions

View File

@@ -34,11 +34,14 @@ class ServerStorage extends Vue {
}
this.hashedStorageKey = utils.toBase58(cryptoUtils.sha256(this.serverStorageKey));
this.oldProfiles = this.profiles;
await this.loadProfiles();
this.checkCurrentProfile();
}
get serverSyncEnabled() {
return this.$store.state.reader.serverSyncEnabled;
}
get settings() {
return this.$store.state.reader.settings;
}
@@ -79,7 +82,7 @@ class ServerStorage extends Vue {
}
async loadProfiles() {
if (!this.currentProfile)
if (!this.serverSyncEnabled)
return;
let prof = await this.storageGet({'profiles': {}});
@@ -103,7 +106,7 @@ class ServerStorage extends Vue {
}
async saveProfiles() {
if (!this.currentProfile || this.savingProfiles)
if (!this.serverSyncEnabled || this.savingProfiles)
return;
const diff = utils.getObjDiff(this.oldProfiles, this.profiles);