fix trending page scroll

fixes #3665
pull/3679/head
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
1 changed files with 7 additions and 1 deletions

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()
}
}