Skip to content

Commit

Permalink
Always show Liquidity Pools section (#2503)
Browse files Browse the repository at this point in the history
Co-authored-by: Sophia <[email protected]>
  • Loading branch information
onnovisser and sophialittlejohn authored Oct 16, 2024
1 parent 9f23153 commit ac88888
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions centrifuge-app/src/pages/IssuerPool/Investors/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useRef } from 'react'
import { useParams } from 'react-router'
import { LoadBoundary } from '../../../components/LoadBoundary'
import { useSuitableAccounts } from '../../../utils/usePermissions'
Expand All @@ -23,19 +22,15 @@ function IssuerPoolInvestors() {
if (!poolId) throw new Error('Pool not found')

const canEditInvestors = useSuitableAccounts({ poolId, poolRole: ['InvestorAdmin'] }).length > 0
const isPoolAdmin = useSuitableAccounts({ poolId, poolRole: ['PoolAdmin'] }).length > 0

// This is a bit hacky, but when deploying a pool to a domain, the user needs to switch networks
// And when they're connected to the other network, they won't register as a pool admin anymore
const wasAdminRef = useRef(isPoolAdmin)
if (isPoolAdmin) {
wasAdminRef.current = true
}

return (
<>
{canEditInvestors && <InvestorStatus />}
{wasAdminRef.current && <LiquidityPools />}
{/*
Always render the Liquidity Pools section, because the admin needs to do actions with an EVM wallet and
won't be able to see it if we check for admin permissions.
*/}
<LiquidityPools />
</>
)
}

0 comments on commit ac88888

Please sign in to comment.