diff --git a/src/App.tsx b/src/App.tsx index c31c658..3bd3147 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -41,15 +41,15 @@ function App() { } - > + /> } - > + /> } - > + /> } /> diff --git a/src/components/TermsAndConditionsBox.tsx b/src/components/TermsAndConditionsBox.tsx index 18004b9..ccc3a3c 100644 --- a/src/components/TermsAndConditionsBox.tsx +++ b/src/components/TermsAndConditionsBox.tsx @@ -16,6 +16,7 @@ const TermsAndConditionsBox = ({ height, onLoad }: TermsAndConditionsBoxProps ) function onDocumentLoadSuccess({ numPages }: { numPages: number }): void { setNumPages(numPages); + if (onLoad){ onLoad(); }; diff --git a/src/pages/ConnectWallet.tsx b/src/pages/ConnectWallet.tsx index fbe8115..e904c33 100644 --- a/src/pages/ConnectWallet.tsx +++ b/src/pages/ConnectWallet.tsx @@ -15,25 +15,27 @@ const ConnectWallet = () => { const redirectTo = searchParams.get("redirectTo"); - useEffect(()=>{ + useEffect(() => { if (signClient && !session) { checkPersistedState(signClient); } }, [checkPersistedState, signClient, session]); useEffect(() => { - if (session) { - if (redirectTo){ - navigate(`/${redirectTo}`, { - state: location.state - }); + if (!session) { + return; + } - } - else { - navigate("/sign-with-nitro-key", { - state: location.state - }); - } + if (redirectTo) { + navigate(`/${redirectTo}`, { + state: location.state + }); + } + + else { + navigate("/sign-with-nitro-key", { + state: location.state + }); } }, [session, navigate, redirectTo, location.state]); diff --git a/src/pages/SignWithNitroKey.tsx b/src/pages/SignWithNitroKey.tsx index 8d610e3..0edb193 100644 --- a/src/pages/SignWithNitroKey.tsx +++ b/src/pages/SignWithNitroKey.tsx @@ -24,7 +24,7 @@ const SignWithNitroKey = () => { const location = useLocation(); useEffect(() => { - if (!session){ + if (!session) { navigate("/connect-wallet?redirectTo=sign-with-nitro-key", { state: location.state, });