Explorar el Código

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

Book Pauk hace 6 años
padre
commit
0085ed1ad9
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      client/components/Reader/share/bookManager.js

+ 4 - 1
client/components/Reader/share/bookManager.js

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