From d0bbb296b70ed856c18b4525a15e94e76eccf48b Mon Sep 17 00:00:00 2001 From: gofnnp Date: Mon, 15 Apr 2024 20:39:13 +0400 Subject: [PATCH] fix: force parameter --- src/components/App/index.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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