Небольшие поправки
This commit is contained in:
@@ -90,7 +90,7 @@ class ServerStorage extends Vue {
|
|||||||
this.prevServerStorageKey = this.serverStorageKey;
|
this.prevServerStorageKey = this.serverStorageKey;
|
||||||
this.hashedStorageKey = utils.toBase58(cryptoUtils.sha256(this.serverStorageKey));
|
this.hashedStorageKey = utils.toBase58(cryptoUtils.sha256(this.serverStorageKey));
|
||||||
this.keyInited = true;
|
this.keyInited = true;
|
||||||
|
|
||||||
await this.loadProfiles(force);
|
await this.loadProfiles(force);
|
||||||
this.checkCurrentProfile();
|
this.checkCurrentProfile();
|
||||||
await this.currentProfileChanged(force);
|
await this.currentProfileChanged(force);
|
||||||
|
|||||||
@@ -79,19 +79,22 @@ class BookManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let key = null;
|
//"ленивая" загрузка
|
||||||
len = await bmRecentStore.length();
|
(async() => {
|
||||||
for (let i = 0; i < len; i++) {
|
let key = null;
|
||||||
key = await bmRecentStore.key(i);
|
len = await bmRecentStore.length();
|
||||||
if (key) {
|
for (let i = 0; i < len; i++) {
|
||||||
let r = await bmRecentStore.getItem(key);
|
key = await bmRecentStore.key(i);
|
||||||
if (_.isObject(r) && r.key) {
|
if (key) {
|
||||||
this.recent[r.key] = r;
|
let r = await bmRecentStore.getItem(key);
|
||||||
|
if (_.isObject(r) && r.key) {
|
||||||
|
this.recent[r.key] = r;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
await bmRecentStore.removeItem(key);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
await bmRecentStore.removeItem(key);
|
|
||||||
}
|
}
|
||||||
}
|
})();
|
||||||
|
|
||||||
//размножение для дебага
|
//размножение для дебага
|
||||||
/*if (key) {
|
/*if (key) {
|
||||||
@@ -410,6 +413,11 @@ class BookManager {
|
|||||||
this.recentLast = value;
|
this.recentLast = value;
|
||||||
await bmCacheStore.setItem('recent-last', this.recentLast);
|
await bmCacheStore.setItem('recent-last', this.recentLast);
|
||||||
if (value && value.key) {
|
if (value && value.key) {
|
||||||
|
//гарантия переключения книги
|
||||||
|
const mostRecent = this.mostRecentBook();
|
||||||
|
if (mostRecent)
|
||||||
|
this.recent[mostRecent.key].touchTime = value.touchTime - 1;
|
||||||
|
|
||||||
this.recent[value.key] = value;
|
this.recent[value.key] = value;
|
||||||
await bmRecentStore.setItem(value.key, value);
|
await bmRecentStore.setItem(value.key, value);
|
||||||
await bmCacheStore.setItem('recent', this.recent);
|
await bmCacheStore.setItem('recent', this.recent);
|
||||||
|
|||||||
Reference in New Issue
Block a user