From 3b848a5a86f25e212bb7c54f54afe48ad230b0c9 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Wed, 23 Oct 2019 20:07:38 +0700 Subject: [PATCH 1/3] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3?= =?UTF-8?q?=D0=B0=20nginx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/omnireader/omnireader | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/omnireader/omnireader b/docs/omnireader/omnireader index a277f3cd..291acc0a 100644 --- a/docs/omnireader/omnireader +++ b/docs/omnireader/omnireader @@ -15,7 +15,7 @@ server { gzip_types *; location /api { - proxy_pass http://localhost:44081; + proxy_pass http://127.0.0.1:44081; } location / { @@ -44,7 +44,7 @@ server { gzip_types *; location /api { - proxy_pass http://localhost:44081; + proxy_pass http://127.0.0.1:44081; } location /tmp { From 20b74a9dcdf8921d8f0ccfc61f91f67b7a09f305 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Wed, 23 Oct 2019 20:42:14 +0700 Subject: [PATCH 2/3] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/Reader.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index fc37ac4b..54e73f8c 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -295,7 +295,9 @@ class Reader extends Vue { this.updateRoute(); }, 1000); - this.debouncedSetRecentBook = _.debounce(async(newValue) => { + this.debouncedSetRecentBook = _.throttle(async(newValue) => { + await utils.sleep(300); + const recent = this.mostRecentBook(); if (recent && (recent.bookPos != newValue || recent.bookPosSeen !== this.bookPosSeen)) { await bookManager.setRecentBook(Object.assign({}, recent, {bookPos: newValue, bookPosSeen: this.bookPosSeen})); From 9ac3be455ca79b5eafb038f1dfa1417b901e2321 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Wed, 23 Oct 2019 23:53:37 +0700 Subject: [PATCH 3/3] =?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/Reader.vue | 35 ++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index 54e73f8c..ee280323 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -220,14 +220,19 @@ export default @Component({ bookPos: function(newValue) { if (newValue !== undefined && this.activePage == 'TextPage') { const textPage = this.$refs.page; + if (textPage.bookPos != newValue) { textPage.bookPos = newValue; } - this.debouncedSetRecentBook(newValue); + + if (!this.scrollingActive) + this.debouncedSetRecentBook(newValue); + else + this.scrollingSetRecentBook(newValue); } }, routeParamPos: function(newValue) { - if (newValue !== undefined && newValue != this.bookPos) { + if (!this.paramPosIgnore && newValue !== undefined && newValue != this.bookPos) { this.bookPos = newValue; } }, @@ -291,21 +296,24 @@ class Reader extends Vue { this.lastActivePage = false; - this.debouncedUpdateRoute = _.debounce(() => { - this.updateRoute(); - }, 1000); - - this.debouncedSetRecentBook = _.throttle(async(newValue) => { - await utils.sleep(300); - + this.debouncedSetRecentBook = _.debounce(async(newValue) => { const recent = this.mostRecentBook(); if (recent && (recent.bookPos != newValue || recent.bookPosSeen !== this.bookPosSeen)) { await bookManager.setRecentBook(Object.assign({}, recent, {bookPos: newValue, bookPosSeen: this.bookPosSeen})); if (this.actionCur < 0 || (this.actionCur >= 0 && this.actionList[this.actionCur] != newValue)) this.addAction(newValue); + + this.paramPosIgnore = true; + this.updateRoute(); + await this.$nextTick(); + this.paramPosIgnore = false; } - }, 500); + }, 500, {'maxWait':5000}); + + this.scrollingSetRecentBook = _.debounce((newValue) => { + this.debouncedSetRecentBook(newValue); + }, 15000, {'maxWait':20000}); document.addEventListener('fullscreenchange', () => { this.fullScreenActive = (document.fullscreenElement !== null); @@ -345,6 +353,8 @@ class Reader extends Vue { await this.showWhatsNew(); await this.showMigration(); + + this.updateRoute(); })(); } @@ -509,7 +519,6 @@ class Reader extends Vue { if (event.bookPosSeen !== undefined) this.bookPosSeen = event.bookPosSeen; this.bookPos = event.bookPos; - this.debouncedUpdateRoute(); } async bookManagerEvent(eventName, value) { @@ -656,6 +665,10 @@ class Reader extends Vue { page.stopTextScrolling(); } } + + if (!this.scrollingActive) { + this.scrollingSetRecentBook.flush(); + } } stopSearch() {