From 223b5533592cedda05ffbf27d48411ed5c617c3e Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sun, 3 Feb 2019 22:41:24 +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 | 8 +++++++- client/components/Reader/Reader.vue | 9 ++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/client/components/Reader/HistoryPage/HistoryPage.vue b/client/components/Reader/HistoryPage/HistoryPage.vue index 0a3267e2..36aaa911 100644 --- a/client/components/Reader/HistoryPage/HistoryPage.vue +++ b/client/components/Reader/HistoryPage/HistoryPage.vue @@ -120,6 +120,7 @@ class HistoryPage extends Vue { mounted() { this.updateTableData(); + this.mostRecentBook = bookManager.mostRecentBook(); } updateTableData() { @@ -194,12 +195,17 @@ class HistoryPage extends Vue { async handleDel(key) { await bookManager.delRecentBook({key}); - this.$emit('most-recent-book'); this.updateTableData(); + + const newRecent = bookManager.mostRecentBook(); + if (this.mostRecentBook != newRecent) + this.$emit('load-book', newRecent); + this.mostRecentBook = newRecent; } loadBook(url) { this.$emit('load-book', {url}); + this.close(); } close() { diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index cb000338..c1e11765 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -66,7 +66,7 @@ @stop-text-search="stopTextSearch"> - + @@ -485,7 +485,6 @@ class Reader extends Vue { //акивируем страницу с текстом this.$nextTick(async() => { const last = this.mostRecentBookReactive; - const isParsed = await bookManager.hasBookParsed(last); if (!isParsed) { this.$root.$emit('set-app-title'); @@ -508,7 +507,11 @@ class Reader extends Vue { } loadBook(opts) { - this.closeAllTextPages(); + if (!opts) { + this.mostRecentBook(); + return; + } + this.progressActive = true; this.$nextTick(async() => { const progress = this.$refs.page;