Disable nitro key sign button if subscribe ID does not exist
This commit is contained in:
parent
e7581932f8
commit
1792d135d8
@ -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 = () => {
|
||||
<LoadingButton
|
||||
variant="contained"
|
||||
onClick={signEth}
|
||||
disabled={!Boolean(ethAddress)}
|
||||
disabled={!Boolean(ethAddress) || !subscriberIdHash}
|
||||
sx={{ marginTop: 2 }}
|
||||
loading={isLoading}
|
||||
>
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user