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) => {
|
||||
if (currentStep === 1) {
|
||||
history.push('/steps/2');
|
||||
return;
|
||||
}
|
||||
if (currentStep === 2) {
|
||||
history.push('/steps/3');
|
||||
return;
|
||||
}
|
||||
const stepsCount = getStepsCount();
|
||||
if (currentStep === 3 && stepsCount > 3) {
|
||||
history.push('/steps/4');
|
||||
return;
|
||||
}
|
||||
if (currentStep === 3 && stepsCount === 3) {
|
||||
finishWizard();
|
||||
return;
|
||||
}
|
||||
if (currentStep === 4) {
|
||||
if (currentStep < stepsCount) {
|
||||
history.push(`/steps/${currentStep + 1}`);
|
||||
} else {
|
||||
finishWizard();
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user