Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Cannot navigate from /a/[id] to /b/[id] #606

Closed
thgh opened this issue Mar 12, 2019 · 2 comments · Fixed by #610
Closed

Cannot navigate from /a/[id] to /b/[id] #606

thgh opened this issue Mar 12, 2019 · 2 comments · Fixed by #610

Comments

@thgh
Copy link
Contributor

thgh commented Mar 12, 2019

Repro: https://github.com/thgh/sapper-template/tree/repro-606
Steps:

  1. Visit https://todo-xflcnzulor.now.sh/b/same
  2. Notice page: b/same
  3. Click link a/same
  4. Notice page is still b/same (expected a/same)
  5. Refresh
  6. Page is now a/same (correct)

There is two routes

  • /a/[id]/index.svelte
  • /b/[id]/index.svelte

It seems sapper does not detect when navigating between both.

@cudr
Copy link
Contributor

cudr commented Mar 13, 2019

if (!session_dirty && current_branch[i] && current_branch[i].segment === segment) return current_branch[i];

current_branch[i].segment === segment

In this case segments are equals, so app don't change page

@thgh
Copy link
Contributor Author

thgh commented Mar 14, 2019

That code is never reached, it short circuits because part === null

branch = await Promise.all(route.parts.map(async (part, i) => {
props.segments[l] = segments[i + 1]; // TODO make this less confusing
if (!part) return null;

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

Successfully merging a pull request may close this issue.

2 participants