Commit 927d35d5 authored by Jack Short's avatar Jack Short Committed by GitHub

fix: useStablecoinPrice switching between WETH and ETH (#5904)

parent b4e981b2
......@@ -48,7 +48,12 @@ export default function useStablecoinPrice(currency?: Currency): Price<Currency,
}, [currency, stablecoin, trade])
const lastPrice = useRef(price)
if (!price || !lastPrice.current || !price.equalTo(lastPrice.current)) {
if (
!price ||
!lastPrice.current ||
!price.equalTo(lastPrice.current) ||
!price.baseCurrency.equals(lastPrice.current.baseCurrency)
) {
lastPrice.current = price
}
return lastPrice.current
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment