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

did NOT handler history record properly #2

Open
hughgr opened this issue Sep 20, 2016 · 0 comments
Open

did NOT handler history record properly #2

hughgr opened this issue Sep 20, 2016 · 0 comments

Comments

@hughgr
Copy link

hughgr commented Sep 20, 2016

thanks for sharing such a wonderful plugin, but the code handle history record do NOT work properly.

 if (toStackIndex > -1) {
            direction = toStackIndex > fromStackIndex ? DIRECTION.FORWARD : DIRECTION.BACK;
    } else {
            direction = DIRECTION.FORWARD;
            stack.push(toPath);
            sessionStorage.setItem(HIS_KEY, JSON.stringify(stack));
          }

for example if I
A->B1->C
then i back to A, the history record stack still remains [A,B1,C]
then i go to B2, the stack was like [A,B1,C,B2],
then i move to C, oops, the C was in record and index is smaller then B2
so we get "back" instead of "forward"

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

1 participant