X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fcore%2Frouting%2Fcustom-reuse-strategy.ts;h=269b9d193ae6557fea70680ddbd014c1ce861479;hb=ca0f030787a6334609aa1b0c7cea44676adf3632;hp=5d3ad2e6751b44739123850322965d8fca35979a;hpb=fa66c9a601d69f6d57c956a3513e8bbed7ee9616;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/core/routing/custom-reuse-strategy.ts b/client/src/app/core/routing/custom-reuse-strategy.ts index 5d3ad2e67..269b9d193 100644 --- a/client/src/app/core/routing/custom-reuse-strategy.ts +++ b/client/src/app/core/routing/custom-reuse-strategy.ts @@ -1,5 +1,6 @@ import { ComponentRef, Injectable } from '@angular/core' import { ActivatedRouteSnapshot, DetachedRouteHandle, RouteReuseStrategy } from '@angular/router' +import { logger } from '@root-helpers/logger' import { DisableForReuseHook } from './disable-for-reuse-hook' import { PeerTubeRouterService, RouterSetting } from './peertube-router.service' @@ -22,7 +23,7 @@ export class CustomReuseStrategy implements RouteReuseStrategy { const key = this.generateKey(route) this.recentlyUsed = key - console.log('Storing component %s to reuse later.', key) + logger.info(`Storing component ${key} to reuse later.`) const componentRef = (handle as any).componentRef as ComponentRef componentRef.instance.disableForReuse() @@ -46,7 +47,7 @@ export class CustomReuseStrategy implements RouteReuseStrategy { const key = this.generateKey(route) this.recentlyUsed = key - console.log('Reusing component %s.', key) + logger.info(`Reusing component ${key}.`) const handle = this.storedRouteHandles.get(key) if (!handle) return handle; @@ -66,7 +67,7 @@ export class CustomReuseStrategy implements RouteReuseStrategy { this.storedRouteHandles.forEach((r, key) => { if (key === this.recentlyUsed) return - console.log('Removing stored component %s.', key); + logger.info(`Removing stored component ${key}`); (r as any).componentRef.destroy() this.storedRouteHandles.delete(key)