From 99a6b103fec3cd1f153becf321e514c3971e0fa3 Mon Sep 17 00:00:00 2001 From: William Grant Date: Tue, 27 Feb 2024 11:06:07 +1100 Subject: [PATCH] feat: make sure to set the account create state to done --- ts/components/registration/stages/CreateAccount.tsx | 10 +++++++++- ts/state/onboarding/ducks/registration.ts | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ts/components/registration/stages/CreateAccount.tsx b/ts/components/registration/stages/CreateAccount.tsx index 2640e116c..479b0dda1 100644 --- a/ts/components/registration/stages/CreateAccount.tsx +++ b/ts/components/registration/stages/CreateAccount.tsx @@ -1,10 +1,14 @@ import { useEffect, useState } from 'react'; +import { useDispatch } from 'react-redux'; import styled from 'styled-components'; import { SettingsKey } from '../../../data/settings-key'; import { ToastUtils } from '../../../session/utils'; import { sanitizeSessionUsername } from '../../../session/utils/String'; import { trigger } from '../../../shims/events'; -import { AccountCreation } from '../../../state/onboarding/ducks/registration'; +import { + AccountCreation, + setAccountCreationStep, +} from '../../../state/onboarding/ducks/registration'; import { useOnboardAccountCreationStep, useOnboardGeneratedRecoveryPhrase, @@ -95,6 +99,8 @@ export const CreateAccount = () => { const generatedRecoveryPhrase = useOnboardGeneratedRecoveryPhrase(); const hexGeneratedPubKey = useOnboardHexGeneratedPubKey(); + const dispatch = useDispatch(); + const [displayName, setDisplayName] = useState(''); const [displayNameError, setDisplayNameError] = useState(''); @@ -114,6 +120,8 @@ export const CreateAccount = () => { displayName, generatedRecoveryPhrase, }); + + dispatch(setAccountCreationStep(AccountCreation.Done)); }; return ( diff --git a/ts/state/onboarding/ducks/registration.ts b/ts/state/onboarding/ducks/registration.ts index 0695f1dee..137ad75c3 100644 --- a/ts/state/onboarding/ducks/registration.ts +++ b/ts/state/onboarding/ducks/registration.ts @@ -13,7 +13,7 @@ export enum AccountCreation { /** starting screen */ DisplayName, /** show conversation screen */ - Complete, + Done, } export enum AccountRestoration {