From 7c6eb257ac2c672429be3196faf13b78c087aa08 Mon Sep 17 00:00:00 2001 From: Simen Fivelstad Smaaberg <66635118+simensma-fresh@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:48:00 +0000 Subject: [PATCH] [MDS-6305] Fix navigation to review & submit page sometimes not working --- .../components/pages/Project/MajorMineApplicationPage.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/minespace-web/src/components/pages/Project/MajorMineApplicationPage.tsx b/services/minespace-web/src/components/pages/Project/MajorMineApplicationPage.tsx index 388482f2ab..4e236b3a14 100644 --- a/services/minespace-web/src/components/pages/Project/MajorMineApplicationPage.tsx +++ b/services/minespace-web/src/components/pages/Project/MajorMineApplicationPage.tsx @@ -40,6 +40,13 @@ export const MajorMineApplicationPage: FC = () => { const defaultCurrent = routeState?.current ?? 0; const [current, setCurrent] = useState(defaultCurrent); + useEffect(() => { + if (defaultCurrent !== current) { + // Make sure the current step is updated if the rootState changes + setCurrent(defaultCurrent); + } + }, [defaultCurrent]); + const [loaded, setLoaded] = useState(false); const [confirmedSubmission, setConfirmedSubmission] = useState(false); const majorMineApplicationGuid =