aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-20 14:27:30 +0200
committerChocobozzz <me@florianbigard.com>2018-04-20 14:27:30 +0200
commit2a2c19dfef7a9aa313c6ca0798f271c9a63449a9 (patch)
treee6c87798105b64fc5dc44705532965cc6c96bd06 /client/src/app/shared/video
parent6d492e562cdc80d986323e9b5ee14953d3956e18 (diff)
downloadPeerTube-2a2c19dfef7a9aa313c6ca0798f271c9a63449a9.tar.gz
PeerTube-2a2c19dfef7a9aa313c6ca0798f271c9a63449a9.tar.zst
PeerTube-2a2c19dfef7a9aa313c6ca0798f271c9a63449a9.zip
Replace current state when changing page
Diffstat (limited to 'client/src/app/shared/video')
-rw-r--r--client/src/app/shared/video/abstract-video-list.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts
index 7f2cf2d7e..728c864e9 100644
--- a/client/src/app/shared/video/abstract-video-list.ts
+++ b/client/src/app/shared/video/abstract-video-list.ts
@@ -1,5 +1,6 @@
1import { ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core' 1import { ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { Location } from '@angular/common'
3import { isInMobileView } from '@app/shared/misc/utils' 4import { isInMobileView } from '@app/shared/misc/utils'
4import { InfiniteScrollerDirective } from '@app/shared/video/infinite-scroller.directive' 5import { InfiniteScrollerDirective } from '@app/shared/video/infinite-scroller.directive'
5import { NotificationsService } from 'angular2-notifications' 6import { NotificationsService } from 'angular2-notifications'
@@ -40,6 +41,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
40 protected abstract authService: AuthService 41 protected abstract authService: AuthService
41 protected abstract router: Router 42 protected abstract router: Router
42 protected abstract route: ActivatedRoute 43 protected abstract route: ActivatedRoute
44 protected abstract location: Location
43 protected abstract currentRoute: string 45 protected abstract currentRoute: string
44 abstract titlePage: string 46 abstract titlePage: string
45 47
@@ -164,8 +166,10 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
164 } 166 }
165 167
166 protected setNewRouteParams () { 168 protected setNewRouteParams () {
167 const routeParams = this.buildRouteParams() 169 const paramsObject = this.buildRouteParams()
168 this.router.navigate([ this.currentRoute ], { queryParams: routeParams }) 170
171 const queryParams = Object.keys(paramsObject).map(p => p + '=' + paramsObject[p]).join('&')
172 this.location.replaceState(this.currentRoute, queryParams)
169 } 173 }
170 174
171 protected buildVideoPages () { 175 protected buildVideoPages () {