Skip to content

Commit

Permalink
Ensure buildSubtree is called on property change
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Tsao authored and steventsao committed Feb 20, 2021
1 parent 760d830 commit 99b9cde
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions ember_debug/route-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,21 @@ function buildSubTree(routeTree, route) {

// Skip when route is an unresolved promise
if (typeof routeHandler?.then === 'function') {
continue;
// ensure we rebuild the route tree when this route is resolved
routeHandler.then(() => this.notifyPropertyChange('routeTree'));
controllerName = '(unresolved)';
controllerClassName = '(unresolved)';
templateName = '(unresolved)';
} else {
controllerName =
routeHandler.get('controllerName') || routeHandler.get('routeName');
controllerFactory = owner.factoryFor
? owner.factoryFor(`controller:${controllerName}`)
: owner._lookupFactory(`controller:${controllerName}`);
controllerClassName = this.getClassName(controllerName, 'controller');
templateName = this.getClassName(handler, 'template');
}

controllerName =
routeHandler.get('controllerName') || routeHandler.get('routeName');
controllerFactory = owner.factoryFor
? owner.factoryFor(`controller:${controllerName}`)
: owner._lookupFactory(`controller:${controllerName}`);
controllerClassName = this.getClassName(controllerName, 'controller');
templateName = this.getClassName(handler, 'template');

subTree[handler] = {
value: {
name: handler,
Expand Down

0 comments on commit 99b9cde

Please sign in to comment.