From d4b4f21cf1d97b510adbcba346ceb7986e3da944 Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Wed, 12 May 2021 12:56:54 +0300 Subject: [PATCH] fix navigation on refresh --- apps/red-ui/src/app/state/app-state.service.ts | 2 +- apps/red-ui/src/app/utils/custom-route-reuse.strategy.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/red-ui/src/app/state/app-state.service.ts b/apps/red-ui/src/app/state/app-state.service.ts index a220dec12..2dee840ff 100644 --- a/apps/red-ui/src/app/state/app-state.service.ts +++ b/apps/red-ui/src/app/state/app-state.service.ts @@ -72,7 +72,7 @@ export class AppStateService { this._router.events.subscribe((event: Event) => { if (AppStateService._isFileOverviewRoute(event)) { const url = (event as ResolveStart).url.replace('/main/projects/', ''); - const [projectId, , fileId] = url.split('/'); + const [projectId, , fileId] = url.split(/[/?]/); this.activateFile(projectId, fileId); } if (AppStateService._isProjectOverviewRoute(event)) { diff --git a/apps/red-ui/src/app/utils/custom-route-reuse.strategy.ts b/apps/red-ui/src/app/utils/custom-route-reuse.strategy.ts index 4ea02ce79..a1075e72e 100644 --- a/apps/red-ui/src/app/utils/custom-route-reuse.strategy.ts +++ b/apps/red-ui/src/app/utils/custom-route-reuse.strategy.ts @@ -49,7 +49,7 @@ export class CustomRouteReuseStrategy implements RouteReuseStrategy { } shouldReuseRoute(future: ActivatedRouteSnapshot, current: ActivatedRouteSnapshot): boolean { - return this._getKey(future) === this._getKey(current); + return future.routeConfig === current.routeConfig || this._getKey(future) === this._getKey(current); } private _getKey(route: ActivatedRouteSnapshot): string {