diff --git a/ts/components/registration/stages/CreateAccount.tsx b/ts/components/registration/stages/CreateAccount.tsx index 437ad5a53..e862b0200 100644 --- a/ts/components/registration/stages/CreateAccount.tsx +++ b/ts/components/registration/stages/CreateAccount.tsx @@ -58,6 +58,10 @@ export const CreateAccount = () => { }, [step, hexGeneratedPubKey]); const signUpWithDetails = async () => { + if (!(!!displayName && !displayNameError)) { + return; + } + try { await signUp({ displayName, diff --git a/ts/components/registration/stages/RestoreAccount.tsx b/ts/components/registration/stages/RestoreAccount.tsx index 3c0eddcb5..c4bdef637 100644 --- a/ts/components/registration/stages/RestoreAccount.tsx +++ b/ts/components/registration/stages/RestoreAccount.tsx @@ -114,6 +114,10 @@ export const RestoreAccount = () => { useRecoveryProgressEffect({ step, progress, setProgress, displayName, dispatch }); const recoverAndFetchDisplayName = async () => { + if (!(!!recoveryPassword && !recoveryPasswordError)) { + return; + } + setProgress(0); try { const displayNameFromNetwork = await signInAndFetchDisplayName({ @@ -150,6 +154,10 @@ export const RestoreAccount = () => { }; const recoverAndEnterDisplayName = async () => { + if (!(!!recoveryPassword && !recoveryPasswordError) || !(!!displayName && !displayNameError)) { + return; + } + setProgress(0); try { await signInWithNewDisplayName({ @@ -244,7 +252,6 @@ export const RestoreAccount = () => { onClick={recoverAndEnterDisplayName} text={window.i18n('continue')} disabled={ - // TODO Fix that even if there is an error we only care if there is something in the input check Create Account !(!!recoveryPassword && !recoveryPasswordError) || !(!!displayName && !displayNameError) }