-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Completes onboarding upon importing seed phrase #8873
Conversation
...first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that completeOnboarding
is still being called on the final page, so it's now called twice redundantly. It is still needed there for the "Create wallet" flow though I suppose, and calling completeOnboarding
twice doesn't seem particularly harmful.
It would be nice to make this same change on the "Create wallet" flow though. Then this bug would be fixed for that flow as well, and we could remove the redundant completeOnboarding
call.
...first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js
Outdated
Show resolved
Hide resolved
@Gudahtt - this is now done for the Create Account flow, and the now redundant call has been removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
The bug with our onboarding library integration was introduced in #8873 because of a change in when `completeOnboarding` was called. We hadn't realized at the time that the onboarding integration relied upon the onboarding completing event to know when the onboarding state should be cleared. Because onboarding is now marked as completed earlier, the state was cleared just as it was intended to be used. The onboarding completed event has been moved back to where it was before: after the user exits the "end of flow" page. The original problem that #8873 was addressing was a routing issue, where the user would be redirected back to the seed phrase confirmation page despite already having confirmed their seed phrase. This was fixed in a different way here, by updating the routing in the first time flow switch to skip straight to the end of flow page if the seed phrase has already been confirmed. This does involve one user-facing change in behavior; if the user opens any MetaMask UI before navigating away from the end-of-flow screen, they will still be considered mid-onboarding so it'll redirect to the end-of-flow screen. But we do mark onboarding as completed if the user closes the tab/window while on the end of flow screen, which was another goal of #8873.
The bug with our onboarding library integration was introduced in #8873 because of a change in when `completeOnboarding` was called. We hadn't realized at the time that the onboarding integration relied upon the onboarding completing event to know when the onboarding state should be cleared. Because onboarding is now marked as completed earlier, the state was cleared just as it was intended to be used. The onboarding completed event has been moved back to where it was before: after the user exits the "end of flow" page. The original problem that #8873 was addressing was a routing issue, where the user would be redirected back to the seed phrase confirmation page despite already having confirmed their seed phrase. This was fixed in a different way here, by updating the routing in the first time flow switch to skip straight to the end of flow page if the seed phrase has already been confirmed. This does involve one user-facing change in behavior; if the user opens any MetaMask UI before navigating away from the end-of-flow screen, they will still be considered mid-onboarding so it'll redirect to the end-of-flow screen. But we do mark onboarding as completed if the user closes the tab/window while on the end of flow screen, which was another goal of #8873.
Fixes: #8679
In the case we assume that the imported phrase is already backed up, onboarding should be completed so users can continue after closing out the "Congratulations!" page.
cc: @danfinlay