Skip to content

Commit

Permalink
fix: handle no distribution for wallet (#7463)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaladinlight authored Aug 1, 2024
1 parent df45092 commit bb26f2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/RFOX/hooks/useLifetimeRewardDistributionsQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ export const useLifetimeRewardDistributionsQuery = ({
.flatMap(epoch =>
stakingAssetAccountAddresses.map(stakingAssetAccountAddress => {
const stakingAddress = getAddress(stakingAssetAccountAddress)
const distribution = epoch.distributionsByStakingAddress[stakingAddress]

if (!distribution) return null

return {
epoch: epoch.number,
stakingAddress,
ipfsHash: epoch.ipfsHash,
...epoch.distributionsByStakingAddress[stakingAddress],
...distribution,
}
}),
)
Expand Down

0 comments on commit bb26f2e

Please sign in to comment.