diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index 90428c15..e28f4225 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -510,15 +510,14 @@ class Reader extends Vue { } async bookManagerEvent(eventName) { - if (eventName == 'recent-changed') { - if (this.recentBooksActive) { - await this.$refs.recentBooksPage.updateTableData(); - } - } - if (eventName == 'set-recent' || eventName == 'recent-deleted') { const oldBook = this.mostRecentBookReactive; const newBook = bookManager.mostRecentBook(); + + if (!(oldBook && newBook && oldBook.key == newBook.key)) { + this.mostRecentBook(); + } + if (oldBook && newBook) { if (oldBook.key != newBook.key) { this.loadingBook = true; @@ -533,6 +532,12 @@ class Reader extends Vue { } } } + + if (eventName == 'recent-changed') { + if (this.recentBooksActive) { + await this.$refs.recentBooksPage.updateTableData(); + } + } } get toolBarActive() { @@ -1063,7 +1068,7 @@ class Reader extends Vue { let page = this.$refs.page; while (this.blinkCount) { this.showRefreshIcon = !this.showRefreshIcon; - if (page.blinkCachedLoadMessage) + if (page && page.blinkCachedLoadMessage) page.blinkCachedLoadMessage(this.showRefreshIcon); await utils.sleep(500); if (this.stopBlink) @@ -1073,7 +1078,7 @@ class Reader extends Vue { } this.showRefreshIcon = true; this.inBlink = false; - if (page.blinkCachedLoadMessage) + if (page && page.blinkCachedLoadMessage) page.blinkCachedLoadMessage('finish'); }); }