Bug hunt - Set current step #206
Merged
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.
What's in this PR?
Rationale for removing the forced redirects:
I started thinking more about these redirects because they started to feel like too much control once I had them working. (There also were tech barriers with isLoggedIn being async, with the initial render showing false even when you are logged in. This leads to the useEffect on 1st render to use the stale 'false' value, so we'd need solve the data load differently to get an accurate value to know whether to direct to the login vs. review page)
In any case, Forcing a redirect to the last page the user was on will drive us to manage that data in the challenge on every page flow, including back buttons, edits, and following breadcrumbs. This may not be wise, as a user might simply navigate in one of those ways without intending to take the form out of review. So we would be putting in more complexity to tightly control the navigation when I don't know that we've proven the need.
This PR does still allow the user to maintain that control - if they want to edit and leave it out of review, 'Save for Later' does so.
I'd prefer for the initial form delivery to simply log the currentStep when they save, and let Product/QA/UAT come back to us with a request for tighter control if needed.