Skip to content

Commit

Permalink
show lp section
Browse files Browse the repository at this point in the history
  • Loading branch information
onnovisser committed Oct 16, 2024
1 parent 983da98 commit 4a528f1
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 4a528f1

Please sign in to comment.