From 962eda78607ed01a3090ea1232dbf1444d3a0ec9 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Wed, 27 Feb 2019 06:12:59 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=B1=D0=B0=D0=B3=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/share/bookManager.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/client/components/Reader/share/bookManager.js b/client/components/Reader/share/bookManager.js index a7daef5a..bc954965 100644 --- a/client/components/Reader/share/bookManager.js +++ b/client/components/Reader/share/bookManager.js @@ -3,7 +3,7 @@ import localForage from 'localforage'; import * as utils from '../../../share/utils'; import BookParser from './BookParser'; -const maxDataSize = 200*1024*1024;//chars, not bytes +const maxDataSize = 500*1024*1024;//chars, not bytes const bmCacheStore = localForage.createInstance({ name: 'bmCacheStore' @@ -27,6 +27,8 @@ class BookManager { //this.booksCached нужен только для ускорения загрузки читалки this.booksCached = await bmCacheStore.getItem('books'); + if (!this.booksCached) + this.booksCached = {}; this.recent = await bmCacheStore.getItem('recent'); this.books = Object.assign({}, this.booksCached); @@ -67,7 +69,12 @@ class BookManager { } await this.cleanBooks(); - this.booksCached = Object.assign({}, this.books); + + this.booksCached = {}; + for (const key in this.books) { + this.booksCached[key] = this.metaOnly(this.books[key]); + } + await bmCacheStore.setItem('books', this.booksCached); } async cleanBooks() {