aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/routing/custom-reuse-strategy.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/core/routing/custom-reuse-strategy.ts')
-rw-r--r--client/src/app/core/routing/custom-reuse-strategy.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/client/src/app/core/routing/custom-reuse-strategy.ts b/client/src/app/core/routing/custom-reuse-strategy.ts
index c2510f1df..3000093a8 100644
--- a/client/src/app/core/routing/custom-reuse-strategy.ts
+++ b/client/src/app/core/routing/custom-reuse-strategy.ts
@@ -1,5 +1,7 @@
1import { Injectable } from '@angular/core' 1import { Injectable } from '@angular/core'
2import { ActivatedRouteSnapshot, DetachedRouteHandle, RouteReuseStrategy } from '@angular/router' 2import { ActivatedRouteSnapshot, DetachedRouteHandle, RouteReuseStrategy } from '@angular/router'
3import { RouterSetting } from './'
4import { PeerTubeRouterService } from './peertube-router.service'
3 5
4@Injectable() 6@Injectable()
5export class CustomReuseStrategy implements RouteReuseStrategy { 7export class CustomReuseStrategy implements RouteReuseStrategy {
@@ -78,6 +80,8 @@ export class CustomReuseStrategy implements RouteReuseStrategy {
78 } 80 }
79 81
80 private isReuseEnabled (route: ActivatedRouteSnapshot) { 82 private isReuseEnabled (route: ActivatedRouteSnapshot) {
81 return route.data.reuse?.enabled && route.queryParams['a-state'] 83 // Cannot use peertube router here because of cyclic router dependency
84 return route.data.reuse?.enabled &&
85 !!(route.queryParams[PeerTubeRouterService.ROUTE_SETTING_NAME] & RouterSetting.REUSE_COMPONENT)
82 } 86 }
83} 87}