Skip to content

Commit

Permalink
frontend - prints
Browse files Browse the repository at this point in the history
  • Loading branch information
omnifient committed May 23, 2022
1 parent 72c41d8 commit efb2f68
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions frontend/src/pages/Success.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async function getClaimDetails(account, targetToken) {
const [chainId, signer, sf] = await getSignerAndFramework();

try {
console.log("getting the subscription");
console.log("getting the subscription", ADDRESSES[chainId]);
const subscription = await sf.idaV1.getSubscription({
publisher: ADDRESSES[chainId].ADDRESS_DCA_SUPERAPP,
indexId: SF_DISTRIBUTION_SUBSCRIPTION_IDX,
Expand All @@ -37,11 +37,15 @@ function Success({ chainId, account, connectWallet }) {
const [claimStatus, setClaimStatus] = useState(false);

useEffect(() => {
getClaimDetails(account, ADDRESSES[chainId].ADDRESS_ETHGX).then(
(subscription) => {
setClaimStatus(subscription.exist);
}
);
console.log("[success] account", account);
if (account) {
getClaimDetails(account, ADDRESSES[chainId].ADDRESS_ETHGX).then(
(subscription) => {
console.log("[success] subscription in use effect", subscription);
setClaimStatus(subscription.exist);
}
);
}
}, [account, chainId]);

return (
Expand Down

0 comments on commit efb2f68

Please sign in to comment.