Skip to content

Commit

Permalink
This change will show the product during the task completion
Browse files Browse the repository at this point in the history
  • Loading branch information
den4ik1203 committed May 24, 2024
1 parent fff1cb8 commit 95f272d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/webapp/src/containers/Task/TaskComplete/StepOne.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { productsSelector } from '../../productSlice';
import { certifierSurveySelector } from '../../OrganicCertifierSurvey/slice';
import { useDispatch } from 'react-redux';
import { setPersistedPaths } from '../../hooks/useHookFormPersist/hookFormPersistSlice';
import { getProducts } from '../saga';

function TaskCompleteStepOne({ history, match, location }) {
const {
Expand All @@ -30,15 +31,20 @@ function TaskCompleteStepOne({ history, match, location }) {
};

const dispatch = useDispatch();
useEffect(() => {
dispatch(getProducts());
}, [dispatch]);

useEffect(() => {
dispatch(
setPersistedPaths([`/tasks/${task_id}/complete`, `/tasks/${task_id}/before_complete`]),
);
}, []);
}, [dispatch, task_id]);

return (
<HookFormPersistProvider>
<PureCompleteStepOne
key={products.length} // Adding key prop to force re-render
onContinue={onContinue}
onGoBack={onGoBack}
system={system}
Expand Down

0 comments on commit 95f272d

Please sign in to comment.