Skip to content

Commit

Permalink
set currentRoute during loading transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
sly7-7 committed Mar 7, 2021
1 parent efb37aa commit e246785
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/@ember/-internals/routing/lib/system/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ class EmberRouter extends EmberObject {

intermediateTransitionTo(name: string, ...args: any[]) {
this._routerMicrolib.intermediateTransitionTo(name, ...args);

updatePaths(this);

if (DEBUG) {
Expand Down Expand Up @@ -1306,6 +1306,8 @@ let defaultActionHandlers = {
let loadingRouteName = findRouteStateName(route, 'loading');
if (loadingRouteName) {
router.intermediateTransitionTo(loadingRouteName);
const infos = router._routerMicrolib.currentRouteInfos!;
router.set('currentRoute', infos[infos.length - 1]);
return false;
}
}
Expand All @@ -1314,6 +1316,8 @@ let defaultActionHandlers = {
let loadingSubstateName = findRouteSubstateName(route, 'loading');
if (loadingSubstateName) {
router.intermediateTransitionTo(loadingSubstateName);
const infos = router._routerMicrolib.currentRouteInfos!;
router.set('currentRoute', infos[infos.length - 1]);
return false;
}

Expand Down

0 comments on commit e246785

Please sign in to comment.