mirror of
https://github.com/gotson/komga.git
synced 2025-12-21 07:56:57 +01:00
refactor: merge update route code
This commit is contained in:
parent
3025e953ab
commit
53711c8800
1 changed files with 11 additions and 10 deletions
|
|
@ -137,11 +137,7 @@ export default Vue.extend({
|
|||
},
|
||||
watch: {
|
||||
sortActive () {
|
||||
this.$router.replace({
|
||||
name: this.$route.name,
|
||||
params: { seriesId: this.$route.params.seriesId, index: this.$route.params.index },
|
||||
query: { sort: `${this.sortActive.key},${this.sortActive.order}` }
|
||||
})
|
||||
this.updateRoute()
|
||||
this.reloadData(this.seriesId)
|
||||
}
|
||||
},
|
||||
|
|
@ -212,13 +208,18 @@ export default Vue.extend({
|
|||
const index = (max === undefined ? 0 : max).toString()
|
||||
|
||||
if (this.$route.params.index !== index) {
|
||||
this.$router.replace({
|
||||
name: this.$route.name,
|
||||
params: { seriesId: this.$route.params.seriesId, index: index },
|
||||
query: { sort: `${this.sortActive.key},${this.sortActive.order}` }
|
||||
})
|
||||
this.updateRoute(index)
|
||||
}
|
||||
},
|
||||
updateRoute (index?: string) {
|
||||
this.$router.replace({
|
||||
name: this.$route.name,
|
||||
params: { seriesId: this.$route.params.seriesId, index: index || this.$route.params.index },
|
||||
query: {
|
||||
sort: `${this.sortActive.key},${this.sortActive.order}`
|
||||
}
|
||||
})
|
||||
},
|
||||
reloadData (seriesId: number) {
|
||||
this.totalElements = null
|
||||
this.pagesState = []
|
||||
|
|
|
|||
Loading…
Reference in a new issue