diff --git a/products/statement-generator/src/components-layout/FlowNavigation.tsx b/products/statement-generator/src/components-layout/FlowNavigation.tsx index 8bbd3542..fb485c50 100644 --- a/products/statement-generator/src/components-layout/FlowNavigation.tsx +++ b/products/statement-generator/src/components-layout/FlowNavigation.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useContext } from 'react'; +import React, { useContext } from 'react'; import { makeStyles, createStyles } from '@material-ui/core'; import FormStateContext from 'contexts/FormStateContext'; @@ -47,21 +47,21 @@ export default function FlowNavigation({ const backBtnTheme = appTheme === 'dark' ? 'transparent-on-dark' : 'transparent-on-light'; - const handleBack = useCallback(() => { + const handleBack = () => { if (onBack) { onBack(); } else { goBackStep(); } - }, []); + }; - const handleNext = useCallback(() => { + const handleNext = () => { if (onNext) { onNext(); } else { goNextStep(); } - }, []); + }; return (
diff --git a/products/statement-generator/src/contexts/FormStateContext.tsx b/products/statement-generator/src/contexts/FormStateContext.tsx index 159661ac..cdfe4cd8 100644 --- a/products/statement-generator/src/contexts/FormStateContext.tsx +++ b/products/statement-generator/src/contexts/FormStateContext.tsx @@ -38,7 +38,7 @@ export const FormStateContextProvider = ({ if ( (suggestedNext === AppUrl.Unemployment || suggestedNext === AppUrl.UnemploymentPreview) && - formState.involvement.isJobChecked + !formState.involvement.isUnemploymentChecked ) { return getNextStep(suggestedNext); } @@ -75,6 +75,14 @@ export const FormStateContextProvider = ({ return getNextStep(suggestedNext); } + if ( + (suggestedNext === AppUrl.SomethingElse || + suggestedNext === AppUrl.SomethingElsePreview) && + !formState.involvement.isSomethingElseChecked + ) { + return getNextStep(suggestedNext); + } + return suggestedNext; } diff --git a/products/statement-generator/src/pages-form/InvolvementInitialFlow.tsx b/products/statement-generator/src/pages-form/InvolvementInitialFlow.tsx index 0b4138c8..045f7ee6 100644 --- a/products/statement-generator/src/pages-form/InvolvementInitialFlow.tsx +++ b/products/statement-generator/src/pages-form/InvolvementInitialFlow.tsx @@ -56,19 +56,6 @@ function InvolvementInitialFlow() { const onCheckboxChange = (evt: React.ChangeEvent) => { const { id, checked } = evt.currentTarget; - if (id === 'isNoneChecked' && checked) { - updateStepToForm({ - involvement: { - isJobChecked: false, - isUnemployementChecked: false, - isRecoveryChecked: false, - isSchoolChecked: false, - isParentingChecked: false, - isCommunityChecked: false, - }, - }); - return; - } const changes = { [id]: Boolean(checked), };