diff --git a/src/components/App/index.tsx b/src/components/App/index.tsx index f917276..74055fd 100755 --- a/src/components/App/index.tsx +++ b/src/components/App/index.tsx @@ -139,12 +139,16 @@ function App(): JSX.Element { const [searchParams] = useSearchParams(); const jwtToken = searchParams.get("token"); const isForce = searchParams.get("force"); - if (isForce === "true") { - dispatch(actions.userConfig.addIsForceShortPath(true)); - } - if (isForce === "false") { - dispatch(actions.userConfig.addIsForceShortPath(false)); - } + + useEffect(() => { + if (isForce === "true") { + dispatch(actions.userConfig.addIsForceShortPath(true)); + } else { + dispatch(actions.userConfig.addIsForceShortPath(false)); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + const isForceShortPath = useSelector(selectors.selectIsForceShortPath); const { gender: genderFromStore } = useSelector( selectors.selectQuestionnaire