Мелкий рефакторинг

This commit is contained in:
Book Pauk
2019-03-16 02:24:07 +07:00
parent b0c59be340
commit e800dfe796
2 changed files with 22 additions and 24 deletions

View File

@@ -205,9 +205,9 @@ class Reader extends Vue {
mounted() { mounted() {
(async() => { (async() => {
this.$refs.serverStorage.init();
await bookManager.init(this.settings); await bookManager.init(this.settings);
await restoreOldSettings(this.settings, bookManager, this.commit); await restoreOldSettings(this.settings, bookManager, this.commit);
await this.$refs.serverStorage.init();
if (this.$root.rootRoute == '/reader') { if (this.$root.rootRoute == '/reader') {
if (this.routeParamUrl) { if (this.routeParamUrl) {

View File

@@ -90,10 +90,9 @@ class ServerStorage extends Vue {
} }
async saveProfiles() { async saveProfiles() {
if (!this.currentProfile) if (!this.currentProfile || this.savingProfiles)
return; return;
if (!this.savingProfiles) {
this.savingProfiles = true; this.savingProfiles = true;
const diff = utils.getObjDiff(this.oldProfiles, this.profiles); const diff = utils.getObjDiff(this.oldProfiles, this.profiles);
@@ -120,7 +119,6 @@ class ServerStorage extends Vue {
this.savingProfiles = false; this.savingProfiles = false;
} }
}
generateNewServerStorageKey() { generateNewServerStorageKey() {
const key = utils.toBase58(utils.randomArray(32)); const key = utils.toBase58(utils.randomArray(32));