Skip to content

Commit 51fe63a

Browse files
authored
fix: Wrong redirect to positions (#12485)
1 parent d99c161 commit 51fe63a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

apps/web/src/views/Liquidity/LiquidityView.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export const LiquidityView = () => {
210210

211211
const { tokenId: tokenIdFromUrl } = router.query
212212

213-
const parsedTokenId = Number.isFinite(Number(tokenIdFromUrl)) ? BigInt(tokenIdFromUrl as string) : undefined
213+
const parsedTokenId = Number.isInteger(Number(tokenIdFromUrl)) ? BigInt(tokenIdFromUrl as string) : undefined
214214

215215
const { loading: positionDetailsLoading, position: positionDetails } = useV3PositionFromTokenId(parsedTokenId)
216216

@@ -549,14 +549,10 @@ export const LiquidityView = () => {
549549

550550
if (tokenIdFromUrl === 'pools') {
551551
router.replace('/liquidity/pools')
552-
} else {
552+
} else if (!parsedTokenId) {
553553
router.replace('/liquidity/positions')
554554
}
555555

556-
if (!parsedTokenId) {
557-
return null
558-
}
559-
560556
return (
561557
<Box mb="40px">
562558
{!isLoading && <NextSeo title={`${currencyQuote?.symbol}-${currencyBase?.symbol} V3 LP #${tokenIdFromUrl}`} />}

0 commit comments

Comments
 (0)