diff --git a/src/components/@widgets/MakeWidget/subcomponents/RateField/RateField.tsx b/src/components/@widgets/MakeWidget/subcomponents/RateField/RateField.tsx index c705c2b5..9abe6349 100644 --- a/src/components/@widgets/MakeWidget/subcomponents/RateField/RateField.tsx +++ b/src/components/@widgets/MakeWidget/subcomponents/RateField/RateField.tsx @@ -35,13 +35,16 @@ export const RateField: React.FC = ({ [currentRate] ); + const firstDisplayedToken = invertPair ? token2 : token1; + const secondDisplayedToken = invertPair ? token1 : token2; + useEffect(() => { setCurrentRate(rate); - }, [rate]); + }, [rate.toString()]); useEffect(() => { setInvertPair(false); - }, [token1, token2, rate]); + }, [token1, token2, rate.toString()]); function handleClick() { const newInvertState = !invertPair; @@ -56,10 +59,10 @@ export const RateField: React.FC = ({ isButton={isButton} className={className} > - 1{invertPair ? token2 : token1} + 1{firstDisplayedToken} = - {displayRate} - {invertPair ? token1 : token2} + {displayRate} + {secondDisplayedToken} {isButton ? ( ) : (