Skip to content

Commit

Permalink
added allocation dependencies to numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
vnaysngh-mudrex committed Mar 8, 2024
1 parent c64d6e6 commit 341091b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/pages/Rewards/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,6 @@ export default function Rewards() {
setCallData([claimData])
}

const onConnect = () => {}

const { data: claimed_rewards } = useContractRead({
functionName: 'amount_already_claimed',
args: [address as any],
Expand All @@ -400,9 +398,10 @@ export default function Rewards() {
}, [claimed_rewards, address, allocations])

const unclaimed_rewards = useMemo(() => {
if (claimed_rewards === null || claimed_rewards === undefined || !allocated) return 0
if (formattedClaimRewards === null || formattedClaimRewards === undefined || !allocated || !allocations) return 0
return allocations?.subtract(formattedClaimRewards).toExact()
}, [claimed_rewards, address, allocations])
}, [formattedClaimRewards, claimed_rewards, address, allocations, allocated])

const totalRewardsClaimed = allocations?.equalTo(formattedClaimRewards)

const handleConfirmDismiss = () => {
Expand Down

0 comments on commit 341091b

Please sign in to comment.