Rename constant
This commit is contained in:
parent
0dda671e1f
commit
8f5f48f3f0
@ -4,7 +4,6 @@
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@cerc-io/registry-sdk": "^0.2.5",
|
||||
"@cosmjs/crypto": "^0.32.4",
|
||||
"@cosmjs/encoding": "^0.32.4",
|
||||
"@cosmjs/proto-signing": "^0.32.4",
|
||||
"@cosmjs/stargate": "^0.32.4",
|
||||
|
@ -4,4 +4,4 @@ export const REDIRECT_EMAIL_MSG = 'Close this tab and the confirmation link in y
|
||||
|
||||
export const ENABLE_KYC = false;
|
||||
|
||||
export const SUBSCRIBER_ID_HASH_KEY = 'subscriberIdHash';
|
||||
export const HASHED_SUBSCRIBER_ID_KEY = 'subscriberIdHash';
|
||||
|
@ -8,7 +8,7 @@ import SumsubWebSdk from "@sumsub/websdk-react";
|
||||
import { MessageHandler } from "@sumsub/websdk";
|
||||
|
||||
import { config, fetchAccessToken, getAccessTokenExpirationHandler, options } from "../utils/sumsub";
|
||||
import { ENABLE_KYC, SUBSCRIBER_ID_HASH_KEY } from "../constants";
|
||||
import { ENABLE_KYC, HASHED_SUBSCRIBER_ID_KEY } from "../constants";
|
||||
import { Participant } from "../types";
|
||||
|
||||
const registry = new Registry(
|
||||
@ -42,7 +42,7 @@ const OnboardingSuccess = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
localStorage.removeItem(SUBSCRIBER_ID_HASH_KEY);
|
||||
localStorage.removeItem(HASHED_SUBSCRIBER_ID_KEY);
|
||||
|
||||
setParticipant(participant);
|
||||
} catch (error) {
|
||||
|
@ -12,7 +12,7 @@ import { StargateClient } from "@cosmjs/stargate";
|
||||
|
||||
import { useWalletConnectContext } from "../context/WalletConnectContext";
|
||||
import SelectRoleCard, {Role} from "../components/SelectRoleCard";
|
||||
import { SUBSCRIBER_ID_HASH_KEY } from "../constants";
|
||||
import { HASHED_SUBSCRIBER_ID_KEY } from "../constants";
|
||||
|
||||
const SignWithCosmos = () => {
|
||||
const { session, signClient } = useWalletConnectContext();
|
||||
@ -36,7 +36,7 @@ const SignWithCosmos = () => {
|
||||
};
|
||||
|
||||
const ethAddress = innerMessage!.address;
|
||||
const subscriberIdHash = localStorage.getItem(SUBSCRIBER_ID_HASH_KEY);
|
||||
const subscriberIdHash = localStorage.getItem(HASHED_SUBSCRIBER_ID_KEY);
|
||||
|
||||
const createCosmosClient = useCallback(async (endpoint: string) => {
|
||||
return await StargateClient.connect(endpoint);
|
||||
|
@ -13,7 +13,7 @@ import LoadingButton from '@mui/lab/LoadingButton';
|
||||
import { utf8ToHex } from "@walletconnect/encoding";
|
||||
|
||||
import { useWalletConnectContext } from "../context/WalletConnectContext";
|
||||
import { ENABLE_KYC, SUBSCRIBER_ID_HASH_KEY } from "../constants";
|
||||
import { ENABLE_KYC, HASHED_SUBSCRIBER_ID_KEY } from "../constants";
|
||||
|
||||
const SignWithNitroKey = () => {
|
||||
|
||||
@ -39,7 +39,7 @@ const SignWithNitroKey = () => {
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
const subscriberIdHash = useMemo(()=>{
|
||||
return localStorage.getItem(SUBSCRIBER_ID_HASH_KEY);
|
||||
return localStorage.getItem(HASHED_SUBSCRIBER_ID_KEY);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -5,7 +5,7 @@ import { ethers } from 'ethers';
|
||||
|
||||
import { Box, colors, Typography } from '@mui/material';
|
||||
|
||||
import { SUBSCRIBER_ID_HASH_KEY } from '../constants';
|
||||
import { HASHED_SUBSCRIBER_ID_KEY } from '../constants';
|
||||
|
||||
interface JwtPayload {
|
||||
subscriber_id: string;
|
||||
@ -43,7 +43,7 @@ const Thanks: React.FC = () => {
|
||||
const subscriberIdBytes = ethers.utils.toUtf8Bytes(decoded.subscriber_id);
|
||||
const subscriberIdHash = ethers.utils.sha256(subscriberIdBytes);
|
||||
|
||||
localStorage.setItem(SUBSCRIBER_ID_HASH_KEY, subscriberIdHash);
|
||||
localStorage.setItem(HASHED_SUBSCRIBER_ID_KEY, subscriberIdHash);
|
||||
|
||||
navigate('/sign-with-nitro-key');
|
||||
} catch (error) {
|
||||
|
Loading…
Reference in New Issue
Block a user