From dc4bd440d9be77385815f98c4824384c152f2088 Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Tue, 4 May 2021 14:02:20 +0800 Subject: [PATCH] fix(webreader): browser back button would not honor page in query param --- komga-webui/src/views/BookReader.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/komga-webui/src/views/BookReader.vue b/komga-webui/src/views/BookReader.vue index 932657e7..b355ed41 100644 --- a/komga-webui/src/views/BookReader.vue +++ b/komga-webui/src/views/BookReader.vue @@ -427,8 +427,10 @@ export default Vue.extend({ }, async beforeRouteUpdate(to, from, next) { if (to.params.bookId !== from.params.bookId) { - // route update means going to previous/next book, in this case we start from first page - this.setup(to.params.bookId) + // route update means either: + // - going to previous/next book, in this case the query.page is not set, so it will default to first page + // - pressing the back button of the browser and navigating to the previous book, in this case the query.page is set, so we honor it + this.setup(to.params.bookId, Number(to.query.page)) } next() },