Skip to content

Commit

Permalink
fix(navigation-instruction): Wait to swap child routes
Browse files Browse the repository at this point in the history
The waitToSwap variable was not properly being passed to child routes' _commitChanges(), which introduced a timing issue where a child router's baseUrl was not updated before it was bound. This commit adds the variable back in.

Resolves #306
Resolves #552
Resolves aurelia/templating-router#46
  • Loading branch information
davismj committed Nov 23, 2017
1 parent eee7cf9 commit 1432234
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/navigation-instruction.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,15 @@ export class NavigationInstruction {

if (viewPortInstruction.strategy === activationStrategy.replace) {
if (viewPortInstruction.childNavigationInstruction && viewPortInstruction.childNavigationInstruction.parentCatchHandler) {
loads.push(viewPortInstruction.childNavigationInstruction._commitChanges());
loads.push(viewPortInstruction.childNavigationInstruction._commitChanges(waitToSwap));
} else {
if (waitToSwap) {
delaySwaps.push({viewPort, viewPortInstruction});
}
loads.push(viewPort.process(viewPortInstruction, waitToSwap).then((x) => {
if (viewPortInstruction.childNavigationInstruction) {
return viewPortInstruction.childNavigationInstruction._commitChanges();
return viewPortInstruction.childNavigationInstruction._commitChanges(waitToSwap);
}

return undefined;
}));
}
} else {
Expand Down

0 comments on commit 1432234

Please sign in to comment.