From b1937eb8c05500de15adb64669422c79628c43e0 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sun, 24 Mar 2019 11:24:54 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B8=D0=B9=20=D1=80?= =?UTF-8?q?=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE=D1=80=D0=B8=D0=BD=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/Reader.vue | 38 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index 6be8edb4..bbef9b77 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -314,30 +314,28 @@ class Reader extends Vue { this.$refs.historyPage.updateTableData(); } - (async() => { - const oldBook = this.mostRecentBookReactive; - const newBook = bookManager.mostRecentBook(); + const oldBook = this.mostRecentBookReactive; + const newBook = bookManager.mostRecentBook(); - if (oldBook && newBook) { - if (oldBook.key != newBook.key) { - this.loadingBook = true; - try { - await this.loadBook(newBook); - } finally { - this.loadingBook = false; - } - } else if (oldBook.bookPos != newBook.bookPos) { - while (this.loadingBook) await utils.sleep(100); - this.bookPosChanged({bookPos: newBook.bookPos}); + if (oldBook && newBook) { + if (oldBook.key != newBook.key) { + this.loadingBook = true; + try { + await this.loadBook(newBook); + } finally { + this.loadingBook = false; } + } else if (oldBook.bookPos != newBook.bookPos) { + while (this.loadingBook) await utils.sleep(100); + this.bookPosChanged({bookPos: newBook.bookPos}); } + } - if (eventName == 'recent-changed') { - this.debouncedSaveRecentLast(); - } else { - this.debouncedSaveRecent(); - } - })(); + if (eventName == 'recent-changed') { + this.debouncedSaveRecentLast(); + } else { + this.debouncedSaveRecent(); + } } }