Signup: reset signup state before navigation to destination outside Calypso #34078
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 code path that handled navigation outside Calypso (typically site frontend by virtue of the
getSiteDestination
function) didn't callsignupFlowController.reset()
, leaving the signup state in Redux (and in IndexedDB) and causing weird behavior should we return to/start
again shortly after.This patch also unifies the code paths that handle inside- and outside-Calypso destinations, as there is no longer any difference between them. The inside- one used to use
page( ... )
to navigate, but that's no longer true.Also removes the
defer
call that was needed for Flux, but is not needed in Redux-only code.How to test:
Go through a flow that has
getSiteDestination
as destination and doesn't add any cart items that would cause a "layover" at the Calypso checkout page, but goes there directly. One example is the/start/blog
flow where you select a free domain and the free plan.After arriving at the destination site frontend, press the Back button. The flow should start again rather than freezing in a weird state (typically the "Awesome" page with big WP logo).