Skip to content

Commit

Permalink
Fixed bug (introduced during this merge) with network label on claim …
Browse files Browse the repository at this point in the history
…network banner
  • Loading branch information
Leandro committed Mar 17, 2022
1 parent d42ce84 commit 2916b2e
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/custom/pages/Claim/ClaimsOnOtherChainsBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ function _shouldNotDisplayBannerForChain(
const { available, total } = claimInfo
return (
// If this is the same network
// Important, the double equal comparison is intentional!
// Don't be dumb like me and change to triple equal and spend awhile figuring out why it doesn't work...
// eslint-disable-next-line eqeqeq
checkedChain == chainId ||
Number(checkedChain) === chainId ||
// If total claims is 0
total === 0 ||
// If there are no available
Expand Down Expand Up @@ -94,14 +91,6 @@ function ClaimsOnOtherChainsBanner({ className }: { className?: string }) {
}, [])
}, [activeClaimAccount, chainId, claimInfoPerAccount])

const networkLabel = useMemo(() => {
if (!chainId) {
return ''
}
const { label } = CHAIN_INFO[chainId]
return label
}, [chainId])

if (chainsWithClaims.length === 0) {
return null
}
Expand All @@ -118,7 +107,7 @@ function ClaimsOnOtherChainsBanner({ className }: { className?: string }) {
return (
<Fragment key={chainId}>
{isLastInMultiple && ' and'}
<ChainSpan onClick={changeNetworksCallback}>{networkLabel}</ChainSpan>
<ChainSpan onClick={changeNetworksCallback}>{CHAIN_INFO[chainId].label}</ChainSpan>
</Fragment>
)
})}
Expand Down

0 comments on commit 2916b2e

Please sign in to comment.