diff --git a/src/pages/SignWithNitroKey.tsx b/src/pages/SignWithNitroKey.tsx index 2b94a71..70eb635 100644 --- a/src/pages/SignWithNitroKey.tsx +++ b/src/pages/SignWithNitroKey.tsx @@ -33,13 +33,14 @@ const SignWithNitroKey = () => { const [cosmosAddress, setCosmosAddress] = useState(""); const [isLoading, setIsLoading] = useState(false); - const subscriberIdHash = localStorage.getItem(SUBSCRIBER_ID_HASH_KEY); - if(!subscriberIdHash){ - setIsLoading(false); - enqueueSnackbar("Subscriber ID not found. Please verify your email and try again", { variant: "error" }); - } + useEffect(() => { + if (!subscriberIdHash) { + setIsLoading(false); + enqueueSnackbar("Subscriber ID not found. Please verify your email and try again", { variant: "error" }); + } + }, [subscriberIdHash]); const message = useMemo(() => { return { @@ -148,7 +149,7 @@ const SignWithNitroKey = () => { diff --git a/src/pages/Thanks.tsx b/src/pages/Thanks.tsx index 794caf3..6cd4c3e 100644 --- a/src/pages/Thanks.tsx +++ b/src/pages/Thanks.tsx @@ -4,6 +4,7 @@ import { jwtDecode } from "jwt-decode"; import { ethers } from 'ethers'; import { Box, colors, Typography } from '@mui/material'; + import { SUBSCRIBER_ID_HASH_KEY } from '../constants'; interface JwtPayload {