From 3b23e769cfe73790de27f6ebd2215f7e2b576144 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Thu, 25 Jul 2024 18:08:20 +0530 Subject: [PATCH] Move config outside function --- src/pages/UserVerification.tsx | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/pages/UserVerification.tsx b/src/pages/UserVerification.tsx index 5747040..6e8a015 100644 --- a/src/pages/UserVerification.tsx +++ b/src/pages/UserVerification.tsx @@ -4,29 +4,28 @@ import { useNavigate } from 'react-router-dom'; import { Box, Typography } from '@mui/material' import SumsubWebSdk from '@sumsub/websdk-react' -const UserVerification = () => { +const config = { + lang: "en", //language of WebSDK texts and comments (ISO 639-1 format) + theme: "light", +} +const options = { + addViewportTag: false, + adaptIframeHeight: true +} + +const UserVerification = () => { const [userId, setUserId] = useState(''); const [applicationSubmitted, setApplicationSubmitted] = useState(false); const navigate = useNavigate(); useEffect(()=>{ - if (applicationSubmitted) { + if (applicationSubmitted && userId !== '') { navigate(`/sign-with-nitro-key/${userId}`) } }, [applicationSubmitted, userId, navigate]); - const config = { - lang: "en", //language of WebSDK texts and comments (ISO 639-1 format) - theme: "light", - } - - const options = { - addViewportTag: false, - adaptIframeHeight: true - } - // TODO: Implement const accessTokenExpirationHandler = async () => { alert("Please renew token");