Skip to content

Commit

Permalink
More resilient checks
Browse files Browse the repository at this point in the history
  • Loading branch information
noisekit committed Nov 26, 2024
1 parent 9b068c8 commit 5147fdc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions liquidity/ui/src/pages/Pool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export const Pool = () => {
const { data: pool, isPending } = usePool(Number(networkId), String(poolId));
const network = NETWORKS.find((n) => n.id === Number(networkId));

const { poolInfo } = pool || {};

const title = poolInfo ? `Pool #${poolInfo[0].pool.id} / ${poolInfo[0].pool.name}` : 'Pool';
const title = pool
? `Pool #${pool.poolInfo?.[0]?.pool?.id} / ${pool.poolInfo?.[0]?.pool?.name}`
: 'Pool';

return (
<>
Expand All @@ -25,7 +25,7 @@ export const Pool = () => {
</Helmet>
<>
<HomeLink mt={4} />
{!isPending && !pool && (
{!isPending && !pool ? (
<Flex
height="100%"
direction="column"
Expand All @@ -40,18 +40,18 @@ export const Pool = () => {
<Link color="cyan.500">Return to Home</Link>
</NavLink>
</Flex>
)}
{!isPending && pool && network && (
) : null}
{!isPending && pool && network ? (
<>
<PoolHeader mt={3} name={poolInfo && poolInfo[0].pool.name} network={network} />
<PoolHeader mt={3} name={pool.poolInfo?.[0]?.pool?.name} network={network} />
<Divider my={6} bg="gray.900" />
<Flex gap={4} mb={16}>
<Box w="100%">
<CollateralSection />
</Box>
</Flex>
</>
)}
) : null}
</>
</>
);
Expand Down

0 comments on commit 5147fdc

Please sign in to comment.