diff --git a/client/components/Reader/HistoryPage/HistoryPage.vue b/client/components/Reader/HistoryPage/HistoryPage.vue index b2a74e12..7f0962eb 100644 --- a/client/components/Reader/HistoryPage/HistoryPage.vue +++ b/client/components/Reader/HistoryPage/HistoryPage.vue @@ -207,8 +207,7 @@ class HistoryPage extends Vue { } loadBook(url) { - if (this.mostRecentBook.url != url) - this.$emit('load-book', {url}); + this.$emit('load-book', {url}); this.close(); } diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index 68ba537d..67610ab4 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -148,6 +148,7 @@ class Reader extends Vue { mostRecentBookReactive = null; created() { + this.loading = true; this.commit = this.$store.commit; this.dispatch = this.$store.dispatch; this.reader = this.$store.state.reader; @@ -187,6 +188,7 @@ class Reader extends Vue { this.loaderActive = true; } } + this.loading = false; })(); } @@ -471,7 +473,7 @@ class Reader extends Vue { else if (this.mostRecentBookReactive) result = 'TextPage'; - if (!result) { + if (!result && !this.loading) { this.loaderActive = true; result = 'LoaderPage'; } @@ -484,7 +486,7 @@ class Reader extends Vue { //акивируем страницу с текстом this.$nextTick(async() => { const last = this.mostRecentBookReactive; - const isParsed = await bookManager.hasBookParsed(last); + const isParsed = bookManager.hasBookParsed(last); if (!isParsed) { this.$root.$emit('set-app-title'); return; @@ -511,6 +513,13 @@ class Reader extends Vue { return; } + // уже просматривается сейчас + const recent = this.mostRecentBook(); + if (recent && recent.url == opts.url && bookManager.hasBookParsed(recent)) { + this.loaderActive = false; + return; + } + this.progressActive = true; this.$nextTick(async() => { const progress = this.$refs.page; diff --git a/client/components/Reader/share/bookManager.js b/client/components/Reader/share/bookManager.js index 01e73029..bb976085 100644 --- a/client/components/Reader/share/bookManager.js +++ b/client/components/Reader/share/bookManager.js @@ -93,7 +93,7 @@ class BookManager { if (!meta.key) meta.key = this.keyFromUrl(meta.url); let book = this.books[meta.key]; - return (book && book.parsed); + return !!(book && book.parsed); } async getBook(meta, callback) {