mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-13 20:06:33 +00:00
fix(validator onboarding): improve code in continue button
This commit is contained in:
parent
5d890fc00e
commit
6e81f0d109
@ -7,7 +7,7 @@ import { useNavigate } from 'react-router-dom'
|
|||||||
import { RootState } from '../../redux/store'
|
import { RootState } from '../../redux/store'
|
||||||
import LinkWithArrow from '../../components/General/LinkWithArrow'
|
import LinkWithArrow from '../../components/General/LinkWithArrow'
|
||||||
import { setActiveStep } from '../../redux/ValidatorOnboarding/slice'
|
import { setActiveStep } from '../../redux/ValidatorOnboarding/slice'
|
||||||
import { KEYSTORE_FILES } from '../../constants'
|
import { KEYSTORE_FILES, STEPPER_PATHS } from '../../constants'
|
||||||
import {
|
import {
|
||||||
setIsConfirmPhraseStage,
|
setIsConfirmPhraseStage,
|
||||||
setIsCopyPastedPhrase,
|
setIsCopyPastedPhrase,
|
||||||
@ -109,32 +109,15 @@ const ContinueButton = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const continueHandler = () => {
|
const continueHandler = () => {
|
||||||
let nextPath
|
let nextPath = STEPPER_PATHS[activeStep] || '/validator-onboarding/'
|
||||||
if (activeStep === 0) nextPath = '/validator-onboarding/advisories'
|
|
||||||
else if (activeStep === 1)
|
|
||||||
nextPath = '/validator-onboarding/validator-setup'
|
if (activeStep === 7) {
|
||||||
else if (activeStep === 2)
|
nextPath = isConfirmPhraseStage ? '/validator-onboarding/deposit' : '/validator-onboarding/key-generation';
|
||||||
nextPath = '/validator-onboarding/validator-setup-install'
|
handleRecoveryMechanism();
|
||||||
else if (activeStep === 3)
|
}
|
||||||
nextPath = '/validator-onboarding/consensus-selection'
|
|
||||||
else if (activeStep === 4)
|
navigate(nextPath);
|
||||||
nextPath = '/validator-onboarding/activation-validator-setup'
|
|
||||||
else if (activeStep === 5) {
|
|
||||||
nextPath = '/validator-onboarding/client-setup'
|
|
||||||
} else if (activeStep === 6) {
|
|
||||||
nextPath = '/validator-onboarding/key-generation'
|
|
||||||
} else if (activeStep === 7) {
|
|
||||||
if (isConfirmPhraseStage) {
|
|
||||||
nextPath = '/validator-onboarding/deposit'
|
|
||||||
} else {
|
|
||||||
nextPath = '/validator-onboarding/key-generation'
|
|
||||||
}
|
|
||||||
handleRecoveryMechanism()
|
|
||||||
} else if (activeStep === 8) nextPath = '/validator-onboarding/activation'
|
|
||||||
else if (activeStep === 9) nextPath = '/dashboard'
|
|
||||||
else nextPath = '/validator-onboarding/'
|
|
||||||
|
|
||||||
navigate(nextPath)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user