Skip to content

Commit

Permalink
chore: User chain data
Browse files Browse the repository at this point in the history
  • Loading branch information
memoyil committed Jan 2, 2025
1 parent 42af634 commit 4db068a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/web/src/hooks/useMerkl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function useMerklInfo(poolAddress?: string): {

if (!merklDataV4) return undefined

return merklDataV4?.[0] || {}
return merklDataV4
},
enabled: Boolean(data && chainId && account && poolAddress),
staleTime: FAST_INTERVAL,
Expand Down Expand Up @@ -148,7 +148,9 @@ export function useMerklInfo(poolAddress?: string): {
pool.rewardsRecord?.breakdowns?.flatMap((breakdown) => breakdown.token.address) || []
).filter((address, index, allAddresses) => allAddresses.indexOf(address) === index)

const rewardsPerTokenObject = userData?.rewards
const chainUserData = userData?.filter((chainUserReward) => chainUserReward?.chain?.id === pool.chainId)?.[0]

const rewardsPerTokenObject = chainUserData?.rewards
?.filter((reward) => rewardAddresses.some((rewardAddress) => isAddressEqual(reward.token.address, rewardAddress)))
.filter((reward) => {
const { amount, claimed } = reward || {}
Expand Down

0 comments on commit 4db068a

Please sign in to comment.