Небольшая оптимизация

This commit is contained in:
Book Pauk
2019-01-14 15:10:59 +07:00
parent 25441262b9
commit 0085ed1ad9

View File

@@ -16,7 +16,6 @@ class BookManager {
if (keySplit.length == 2 && keySplit[0] == 'bmMeta') {
let meta = await localForage.getItem(key);
meta.data = await localForage.getItem(`bmData-${keySplit[1]}`);
this.books[meta.key] = meta;
}
@@ -71,6 +70,10 @@ class BookManager {
meta.key = this.keyFromUrl(meta.url);
result = this.books[meta.key];
if (result && !result.data) {
result.data = await localForage.getItem(`bmData-${meta.key}`);
}
if (result && !result.parsed) {
result = await this.parseBook(result, result.data, callback);
}