Skip to content

Commit

Permalink
fix: ClickablePersonhoodIcon
Browse files Browse the repository at this point in the history
  • Loading branch information
irisdv committed Sep 16, 2024
1 parent c328b6a commit 4241727
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ const ClickablePersonhoodIcon: FunctionComponent<
const [sessionId, setSessionId] = useState<string | undefined>();
const [isOpen, setIsOpen] = useState<boolean>(false);
const [isLoading, setIsLoading] = useState<boolean>(false);
const [callData, setCallData] = useState<Call>();
const [callData, setCallData] = useState<Call[]>([]);
const { addTransaction } = useNotificationManager();
const { sendAsync: execute, data: verifierData } = useSendTransaction({
calls: [callData as Call],
calls: callData,
});
const network =
process.env.NEXT_PUBLIC_IS_TESTNET === "true" ? "testnet" : "mainnet";
Expand All @@ -70,7 +70,7 @@ const ClickablePersonhoodIcon: FunctionComponent<
useEffect(() => {
const executeVerification = () => {
execute().finally(() => {
setCallData(undefined);
setCallData([]);
setIsLoading(false);
setIsOpen(false);
setSessionId(undefined);
Expand Down Expand Up @@ -124,16 +124,16 @@ const ClickablePersonhoodIcon: FunctionComponent<
.then((response) => response.json())
.then((sig) => {
const hexSessionId = "0x" + (sessionId as string).replace(/-/g, "");
setCallData(
setCallData([
identityChangeCalls.writeVerifierData(
process.env.NEXT_PUBLIC_VERIFIER_POP_CONTRACT as string,
tokenId,
Math.floor(Date.now() / 1000 + 15 * 60),
"proof_of_personhood",
hexToDecimal(hexSessionId),
[sig.r, sig.s]
)
);
),
]);
})
.catch((error) =>
console.log("An error occurred while fetching signture", error)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"react-icons": "^4.4.0",
"react-loader-spinner": "5.4.5",
"starknet": "6.9.0",
"starknetid.js": "^4.0.0",
"starknetid.js": "^4.0.1",
"starknetkit": "^2.3.0",
"tldts": "^6.1.20",
"twitter-api-sdk": "^1.2.1"
Expand Down

0 comments on commit 4241727

Please sign in to comment.