From 5a4ef54f52717ecebedb21807aef02f2cd4167f7 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sun, 3 Feb 2019 20:55:19 +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/HistoryPage/HistoryPage.vue | 1 + client/components/Reader/Reader.vue | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/client/components/Reader/HistoryPage/HistoryPage.vue b/client/components/Reader/HistoryPage/HistoryPage.vue index 11311576..0a3267e2 100644 --- a/client/components/Reader/HistoryPage/HistoryPage.vue +++ b/client/components/Reader/HistoryPage/HistoryPage.vue @@ -194,6 +194,7 @@ class HistoryPage extends Vue { async handleDel(key) { await bookManager.delRecentBook({key}); + this.$emit('most-recent-book'); this.updateTableData(); } diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index 5069c2df..cb000338 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -66,7 +66,7 @@ @stop-text-search="stopTextSearch"> - + @@ -145,6 +145,7 @@ class Reader extends Vue { bookPos = null; allowUrlParamBookPos = false; showRefreshIcon = true; + mostRecentBookReactive = null; created() { this.commit = this.$store.commit; @@ -237,6 +238,7 @@ class Reader extends Vue { const result = bookManager.mostRecentBook(); if (!result) this.closeAllTextPages(); + this.mostRecentBookReactive = result; return result; } @@ -467,7 +469,7 @@ class Reader extends Vue { result = 'ProgressPage'; else if (this.loaderActive) result = 'LoaderPage'; - else if (this.mostRecentBook()) + else if (this.mostRecentBookReactive) result = 'TextPage'; if (!result) { @@ -482,7 +484,7 @@ class Reader extends Vue { if (this.lastActivePage != result && result == 'TextPage') { //акивируем страницу с текстом this.$nextTick(async() => { - const last = this.mostRecentBook(); + const last = this.mostRecentBookReactive; const isParsed = await bookManager.hasBookParsed(last); if (!isParsed) { @@ -533,6 +535,7 @@ class Reader extends Vue { // если есть в локальном кеше if (bookParsed) { await bookManager.setRecentBook(Object.assign({bookPos, bookPosSeen}, bookManager.metaOnly(bookParsed))); + this.mostRecentBook(); this.loaderActive = false; progress.hide(); this.progressActive = false; this.blinkCachedLoadMessage(); @@ -572,6 +575,7 @@ class Reader extends Vue { // добавляем в историю await bookManager.setRecentBook(Object.assign({bookPos, bookPosSeen}, bookManager.metaOnly(addedBook))); + this.mostRecentBook(); this.updateRoute(true); this.loaderActive = false;