mirror of
https://github.com/gotson/komga.git
synced 2025-12-20 23:45:11 +01:00
fix(webreader): browser back button would not honor page in query param
This commit is contained in:
parent
9c737ea235
commit
dc4bd440d9
1 changed files with 4 additions and 2 deletions
|
|
@ -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()
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue