Make the code simpler
[MAILPOET-2142]
This commit is contained in:
committed by
Jack Kitterhing
parent
e9918fa236
commit
3521423b52
@@ -8,24 +8,10 @@ export const getStepsCount = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const redirectToNextStep = (history, finishWizard, currentStep) => {
|
export const redirectToNextStep = (history, finishWizard, currentStep) => {
|
||||||
if (currentStep === 1) {
|
|
||||||
history.push('/steps/2');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (currentStep === 2) {
|
|
||||||
history.push('/steps/3');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const stepsCount = getStepsCount();
|
const stepsCount = getStepsCount();
|
||||||
if (currentStep === 3 && stepsCount > 3) {
|
if (currentStep < stepsCount) {
|
||||||
history.push('/steps/4');
|
history.push(`/steps/${currentStep + 1}`);
|
||||||
return;
|
} else {
|
||||||
}
|
|
||||||
if (currentStep === 3 && stepsCount === 3) {
|
|
||||||
finishWizard();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (currentStep === 4) {
|
|
||||||
finishWizard();
|
finishWizard();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user