Pull request #184: fix navigation on refresh

Merge in RED/ui from RED-1478 to master

* commit 'd4b4f21cf1d97b510adbcba346ceb7986e3da944':
  fix navigation on refresh
This commit is contained in:
Timo Bejan 2021-05-12 14:08:29 +02:00
commit 949f086975
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 {