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

Double state change after $state.go in $stateChangeStart #2336

Closed
gligoran opened this issue Oct 26, 2015 · 3 comments
Closed

Double state change after $state.go in $stateChangeStart #2336

gligoran opened this issue Oct 26, 2015 · 3 comments

Comments

@gligoran
Copy link

Here's the plunker. Click on the profile link and note the extra state change in the list:

stateChanges = [
  " -> home",
  "home -> profile",
  "home -> signIn",
  "signIn -> signIn"
]

The problem is that last "signIn -> signIn", which, in my opinion, should not have happened.

I've done some debugging and it seems it's ui-router's reaction to $locationChangeSuccess via the afterLocationChange function.

I also don't understand why the parameter returnTo is double-encoded: /profile -> %2Fprofile -> %252Fprofile.

@gligoran
Copy link
Author

Tried playing around with previous versions and found out this only happens in 0.2.15. After looking at the change log, it seems that this commit is to blame: 48aeaff. If I remove the code commented by that commit, the double transition goes away.

It seems this is connected to #1573.

@eddiemonge
Copy link
Contributor

Is this fixed in a higher version?

@eddiemonge
Copy link
Contributor

Yeah seems fixed in the latest versions. Also, why not use returnTo: toState.name?

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

No branches or pull requests

2 participants