feat: additional check for disable cnt btn in rec phrase

This commit is contained in:
RadoslavDimchev 2023-10-11 22:33:22 +03:00
parent 042df5ab68
commit fd728297e1
1 changed files with 6 additions and 1 deletions

View File

@ -41,7 +41,10 @@ const ContinueButton = () => {
useEffect(() => {
const getDisabledButton = () => {
if (activeStep === 4 && isConfirmPhraseStage) {
if (validWords.some(w => w === false)) {
if (
validWords.some(w => w === false) ||
generatedMnemonic.some((w, i) => w !== mnemonic[i])
) {
return true
}
} else if (activeStep === 3 && !isValidatorSet) {
@ -68,12 +71,14 @@ const ContinueButton = () => {
dispatch(setActiveStep(activeStep + 1))
}
}
const handleStep2 = () => {
if (subStepValidatorSetup === 3) {
return dispatch(setActiveStep(activeStep + 1))
}
dispatch(setSubStepValidatorSetup(subStepValidatorSetup + 1))
}
const handleStep4 = () => {
if (!isConfirmPhraseStage && recoveryMechanism === KEYSTORE_FILES) {
return dispatch(setActiveStep(activeStep + 1))