Skip to content

Commit

Permalink
[BUGFIX beta] Don't rely on non-cached reference
Browse files Browse the repository at this point in the history
This commit fixes a bug where `OutletComponentReference`
inadvertently relied on broken behavior: it returned `null`, assuming
that that would cause the reference to be rebuilt. But
glimmerjs/glimmer-vm#337 fixed the underlying bug, causing the reference to
be properly cached. As a result, we need to remember that we rendered a
`null` component, so that swapping back to the original component
replaces the empty component with the rendered component.
(cherry picked from commit 8cc93b6)
  • Loading branch information
chancancode committed Oct 26, 2016
1 parent db98275 commit 09b3e53
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/ember-glimmer/lib/syntax/outlet.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ class OutletComponentReference {
value() {
let { outletNameRef, parentOutletStateRef, definition, lastState } = this;


let outletName = outletNameRef.value();
let outletStateRef = parentOutletStateRef.get('outlets').get(outletName);
let newState = this.lastState = outletStateRef.value();
Expand All @@ -130,7 +129,7 @@ class OutletComponentReference {
} else if (hasTemplate) {
return this.definition = new OutletComponentDefinition(outletName, newState.render.template);
} else {
return null;
return this.definition = null;
}
}
}
Expand Down

0 comments on commit 09b3e53

Please sign in to comment.