Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update current route in willChangeRoute during an intermediate transition #19450

Merged
merged 2 commits into from
Mar 7, 2021

Conversation

sly7-7
Copy link
Contributor

@sly7-7 sly7-7 commented Mar 7, 2021

Updated to follow @rwjblue comment.
Fixes #19449

Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We chatted a little bit about this in discord this afternoon, I think the thing we decided was:

  • Update router_js to add an isIntermediateTransition to the InternalTransition base class
  • Once landed + released, update EmberRouter's routeWillChange to detect that value and set this.currentRoute to that transitions .to value
  • Add some inline comments explaining why 😛

@@ -548,7 +548,7 @@ class EmberRouter extends EmberObject {

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some odd whitespace here

@sly7-7
Copy link
Contributor Author

sly7-7 commented Mar 7, 2021

Will need tildeio/router.js#321 and a then router bump

@sly7-7 sly7-7 changed the title router service tests, highlights #19449 Update current route in willChangeRoute during an intermediate transition Fixes #19449 Mar 7, 2021
@sly7-7 sly7-7 changed the title Update current route in willChangeRoute during an intermediate transition Fixes #19449 Update current route in willChangeRoute during an intermediate transition Mar 7, 2021
@sly7-7 sly7-7 force-pushed the test-for-19449 branch 2 times, most recently from 9decf9d to 222e5ad Compare March 7, 2021 22:39
Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Thanks for picking this up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Router Service doesn't update currentRoute on loading states
2 participants