Fix Home navigation from the editor: derive the landing deep-link redirect from the router url#323
Merged
Merged
Conversation
…location snapshot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The landing page computed
redirectingonce at component init fromwindow.location.search. During a client-side navigation from/editorback to/, the component initializes before the history entry updates, so the check still saw the editor's query (e.g.?model=...from an example deep link).redirectingcame out spuriously true: the landing rendered empty and immediately bounced back to the editor viareplaceState. Net effect: the Home button set the URL but never navigated.Fix: derive
redirectingfrompage.url.searchParams($app/state), and move the redirect from a one-shotonMountinto an$effectreacting to the same source. Direct deep-link loads (/?model=...,?backend=...) behave exactly as before.Repro before the fix: landing -> click an example (lands on
/editor?model=...) -> click the Home button in the nav bar.