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

Story branching navigation path fixes. #24979

Merged
merged 2 commits into from Oct 9, 2019

Conversation

gmajoulet
Copy link
Contributor

Fixing a few things about the story navigation path.
The updateNavigationPath method used to decide of the target page: you'd call switchTo with a page ID, but it would be overridden in some cases. This was causing different bugs with progress bar and history, as the targetPage was overridden but not the targetPageId.

Instead, the navigation path is now stored and globally accessible. Pages, when getting the previous page id, look up in the navigation path. This way switchTo actually navigates to the page you passed as a parameter, making its behavior easier to predict and removing the previously mentioned bugs.
updateNavigationPath no longer decides of the target page, but only updates the store + history.

@gmajoulet gmajoulet merged commit 77fc8ce into ampproject:master Oct 9, 2019
@gmajoulet gmajoulet deleted the branching_navigation_path branch October 9, 2019 18:52
micajuine-ho pushed a commit to micajuine-ho/amphtml that referenced this pull request Dec 27, 2019
* Story navigation path fixes.

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

Successfully merging this pull request may close these issues.

None yet

3 participants