]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/core/routing/custom-reuse-strategy.ts
Speed up plugins loading
[github/Chocobozzz/PeerTube.git] / client / src / app / core / routing / custom-reuse-strategy.ts
index a9f61acecb7d44bea4ef42dbe75c48fe96627b40..c0f9f04e02605aa91db18f23f23436fff9c998c5 100644 (file)
@@ -1,5 +1,7 @@
 import { ActivatedRouteSnapshot, DetachedRouteHandle, RouteReuseStrategy } from '@angular/router'
+import { Injectable } from '@angular/core'
 
+@Injectable()
 export class CustomReuseStrategy implements RouteReuseStrategy {
   storedRouteHandles = new Map<string, DetachedRouteHandle>()
   recentlyUsed: string
@@ -76,6 +78,6 @@ export class CustomReuseStrategy implements RouteReuseStrategy {
   }
 
   private isReuseEnabled (route: ActivatedRouteSnapshot) {
-    return route.data.reuse && route.data.reuse.enabled && route.queryParams['a-state']
+    return route.data.reuse && route.data.reuse.enabled && route.queryParams[ 'a-state' ]
   }
 }