Skip to content

Commit

Permalink
fix: update auto renewal
Browse files Browse the repository at this point in the history
  • Loading branch information
irisdv committed Oct 12, 2023
1 parent 6a30e73 commit 8e9339a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/identities/actions/identityActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,21 +113,22 @@ const IdentityActions: FunctionComponent<IdentityActionsProps> = ({
if (!address || !identity?.domain) return;
fetch(
`${
process.env.NEXT_PUBLIC_RENEWAL_INDEXER
}/get_renewal_data?address=${hexToDecimal(address)}&domain=${
process.env.NEXT_PUBLIC_SERVER_LINK
}/renewal/get_renewal_data?addr=${hexToDecimal(address)}&domain=${
identity.domain
}`
)
.then((response) => response.json())
.then((data) => {
console.log("renewal_data", data);
if (!data.error && data.enabled) {
setIsAutoRenewalEnabled(true);
setAllowance(data.allowance);
setAllowance(BigInt(data.allowance).toString(10));
} else {
setIsAutoRenewalEnabled(false);
}
});
}, [address, tokenId]);
}, [address, tokenId, identity]);

useEffect(() => {
if (!mainDomainData?.transaction_hash) return;
Expand Down Expand Up @@ -323,7 +324,6 @@ const IdentityActions: FunctionComponent<IdentityActionsProps> = ({
isModalOpen={isAutoRenewalOpen}
callDataEncodedDomain={callDataEncodedDomain}
identity={identity}
// isEnabled={isAutoRenewalEnabled}
domain={identity?.domain}
allowance={allowance}
/>
Expand Down

0 comments on commit 8e9339a

Please sign in to comment.