fix navigation on refresh

This commit is contained in:
Dan Percic 2021-05-12 12:56:54 +03:00
parent 65352263dd
commit d4b4f21cf1
2 changed files with 2 additions and 2 deletions

View File

@ -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)) {

View File

@ -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 {