diff options
Diffstat (limited to 'client/src/app/core/routing/custom-reuse-strategy.ts')
-rw-r--r-- | client/src/app/core/routing/custom-reuse-strategy.ts | 6 |
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 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { ActivatedRouteSnapshot, DetachedRouteHandle, RouteReuseStrategy } from '@angular/router' | 2 | import { ActivatedRouteSnapshot, DetachedRouteHandle, RouteReuseStrategy } from '@angular/router' |
3 | import { RouterSetting } from './' | ||
4 | import { PeerTubeRouterService } from './peertube-router.service' | ||
3 | 5 | ||
4 | @Injectable() | 6 | @Injectable() |
5 | export class CustomReuseStrategy implements RouteReuseStrategy { | 7 | export 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 | } |