1
0
Fork 0

fix trending page scroll

fixes #3665
This commit is contained in:
Rigel Kent 2021-02-01 19:19:40 +01:00
parent c9b369096d
commit fb7b009d63
No known key found for this signature in database
GPG key ID: 5E53E96A494E452F

View file

@ -363,7 +363,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, AfterConte
categoryOneOf: this.categoryOneOf
}
let path = this.router.url
let path = this.getUrlWithoutParams()
if (!path || path === '/') path = this.serverConfig.instance.defaultClientRoute
this.router.navigate([ path ], { queryParams, replaceUrl: true, queryParamsHandling: 'merge' })
@ -380,4 +380,10 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, AfterConte
this.nsfwPolicy = user.nsfwPolicy
}))
}
private getUrlWithoutParams () {
let urlTree = this.router.parseUrl(this.router.url)
urlTree.queryParams = {}
return urlTree.toString()
}
}