fix: disallow duplicate currencies in widget (#4919)

fix: currency equality check
This commit is contained in:
Zach Pomerantz 2022-10-13 11:20:53 -07:00 committed by GitHub
parent 6acc9300c0
commit 0faaa3f0c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -65,7 +65,7 @@ export function useSyncWidgetInputs(defaultToken?: Currency) {
setType(TradeType.EXACT_INPUT)
setTokens(() => {
return {
[otherField]: token === otherToken ? selectingToken : otherToken,
[otherField]: otherToken?.equals(token) ? selectingToken : otherToken,
[selectingField]: token,
}
})