]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
fix trending page scroll
authorRigel Kent <sendmemail@rigelk.eu>
Mon, 1 Feb 2021 18:19:40 +0000 (19:19 +0100)
committerRigel Kent <sendmemail@rigelk.eu>
Mon, 1 Feb 2021 18:19:50 +0000 (19:19 +0100)
fixes #3665

client/src/app/shared/shared-video-miniature/abstract-video-list.ts

index 3e84589cd145ea7ce728ca7a147fe0a4e98b4229..14a29d05fb5ea170dfd03d347f1f945eff7d42f2 100644 (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()
+  }
 }