@@ -9,6 +9,7 @@ import backIcon from '@static/svg/back-arrow.svg'
9
9
import settingIcon from '@static/svg/settings.svg'
10
10
import { ALL_FEE_TIERS_DATA , PositionTokenBlock , REFRESHER_INTERVAL } from '@store/consts/static'
11
11
import {
12
+ addressToTicker ,
12
13
calcPriceBySqrtPrice ,
13
14
calculateConcentrationRange ,
14
15
convertBalanceToBigint ,
@@ -102,6 +103,7 @@ export interface INewPosition {
102
103
isGetLiquidityError : boolean
103
104
onlyUserPositions : boolean
104
105
setOnlyUserPositions : ( val : boolean ) => void
106
+ isLoadingTokens : boolean
105
107
}
106
108
107
109
export const NewPosition : React . FC < INewPosition > = ( {
@@ -153,7 +155,8 @@ export const NewPosition: React.FC<INewPosition> = ({
153
155
unblockUpdatePriceRange,
154
156
isGetLiquidityError,
155
157
onlyUserPositions,
156
- setOnlyUserPositions
158
+ setOnlyUserPositions,
159
+ isLoadingTokens
157
160
} ) => {
158
161
const { classes } = useStyles ( )
159
162
const navigate = useNavigate ( )
@@ -413,14 +416,14 @@ export const NewPosition: React.FC<INewPosition> = ({
413
416
const parsedFee = parseFeeToPathFee ( ALL_FEE_TIERS_DATA [ fee ] . tier . fee )
414
417
415
418
if ( address1 != null && address2 != null ) {
416
- const token1Symbol = tokens [ address1 ] . symbol
417
- const token2Symbol = tokens [ address2 ] . symbol
419
+ const token1Symbol = addressToTicker ( address1 )
420
+ const token2Symbol = addressToTicker ( address2 )
418
421
navigate ( `/newPosition/${ token1Symbol } /${ token2Symbol } /${ parsedFee } ` , { replace : true } )
419
422
} else if ( address1 != null ) {
420
- const tokenSymbol = tokens [ address1 ] . symbol
423
+ const tokenSymbol = addressToTicker ( address1 )
421
424
navigate ( `/newPosition/${ tokenSymbol } /${ parsedFee } ` , { replace : true } )
422
425
} else if ( address2 != null ) {
423
- const tokenSymbol = tokens [ address2 ] . symbol
426
+ const tokenSymbol = addressToTicker ( address2 )
424
427
navigate ( `/newPosition/${ tokenSymbol } /${ parsedFee } ` , { replace : true } )
425
428
} else if ( fee != null ) {
426
429
navigate ( `/newPosition/${ parsedFee } ` , { replace : true } )
@@ -558,7 +561,9 @@ export const NewPosition: React.FC<INewPosition> = ({
558
561
setTokenB ( address2 )
559
562
onChangePositionTokens ( address1 , address2 , fee )
560
563
561
- updatePath ( address1 , address2 , fee )
564
+ if ( ! isLoadingTokens ) {
565
+ updatePath ( address1 , address2 , fee )
566
+ }
562
567
} }
563
568
onAddLiquidity = { ( ) => {
564
569
if ( tokenA !== null && tokenB !== null ) {
@@ -652,7 +657,9 @@ export const NewPosition: React.FC<INewPosition> = ({
652
657
setTokenB ( pom )
653
658
onChangePositionTokens ( tokenB , tokenA , currentFeeIndex )
654
659
655
- updatePath ( tokenB , tokenA , currentFeeIndex )
660
+ if ( ! isLoadingTokens ) {
661
+ updatePath ( tokenB , tokenA , currentFeeIndex )
662
+ }
656
663
} }
657
664
poolIndex = { poolIndex }
658
665
bestTierIndex = { bestTierIndex }
0 commit comments