Skip to content
This repository has been archived by the owner on Sep 20, 2020. It is now read-only.

ignoreDsr option doesn't clean previous DSR record. #31

Closed
albertein opened this issue Jul 24, 2014 · 2 comments
Closed

ignoreDsr option doesn't clean previous DSR record. #31

albertein opened this issue Jul 24, 2014 · 2 comments
Assignees
Labels
Milestone

Comments

@albertein
Copy link

Scenario:

main.product { deepStateRedirect: true }
main.product.child
main.sibling

User goes to main.product and then to main.product.child, the user now wants to go back to the parent state so he does it with a $state.go including the ignoreDsr flag, everything seems to work.

Then the user goes to main.sibling and afterwards he wants to go back to main.product. DSR sends him to main.product.child even when the last substate on that branch was main.product.

Seems that DSR is not popping the record when jumping back to the root state.

@albertein
Copy link
Author

It seems that computeDeepStateStatus must be aware of the ignoreDsr flag, otherwise it never calls recordDeepStateRedirectStatus to record the new status of that specific DSR.

@christopherthielen
Copy link
Owner

Thanks, confirmed! Here's the new unit test:

    it("should reset the remembered deep state after ignoreDsr", function() {
      testGo("tabs.tabs1.deep", {entered: pathFrom('tabs', 'tabs.tabs1.deep') });
      testGo("tabs.tabs2", {entered: 'tabs.tabs2', exited: pathFrom('tabs.tabs1.deep', 'tabs.tabs1')});
      $state.go("tabs.tabs1", {}, { ignoreDsr: true }); $q.flush();
      expect($state.current.name).toBe("tabs.tabs1");
      $state.go("tabs.tabs2", {}, { }); $q.flush();
      expect($state.current.name).toBe("tabs.tabs2");
      $state.go("tabs.tabs1", {}, { }); $q.flush();
      expect($state.current.name).toBe("tabs.tabs1");
    })

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

No branches or pull requests

2 participants