improve code

This commit is contained in:
Hristo Nedelkov 2023-10-06 13:54:36 +03:00
parent 2523319f69
commit 456887fc80
1 changed files with 3 additions and 11 deletions

View File

@ -37,21 +37,12 @@ const ValidatorOnboarding = () => {
const [isAdvisoriesComplete, setIsAdvisoriesComplete] = useState(false)
const unicodeNumbers = ['➀', '➁', '➂', '➃', '➄', '➅']
const advisoriesIcon = unicodeNumbers.map((number, index) => {
if (index <= subStepAdvisories) {
return '✓';
} else {
return number;
}
})
const advisoriesIcon = unicodeNumbers.map((number, index) => index <= subStepAdvisories ? '✓' : number)
const changeActiveStep = (step: number) => {
if (step < activeStep) {
return setActiveStep(step)
}
removeCopyPastePhraseInfoBox()
removeConfirmPhraseStage()
}
@ -61,6 +52,7 @@ const ValidatorOnboarding = () => {
if (subStepAdvisories === 5) {
setIsAdvisoriesComplete(true)
setActiveStep(activeStep + 1)
setSubStepAdvisories(0)
}
return setSubStepAdvisories(subStepAdvisories + 1)
} else if (activeStep === 4 && isConfirmPhraseStage === false) {