From 0faaa3f0c45c76c15472537337c1aae0e60ecdc7 Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Thu, 13 Oct 2022 11:20:53 -0700 Subject: [PATCH] fix: disallow duplicate currencies in widget (#4919) fix: currency equality check --- src/components/Widget/inputs.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Widget/inputs.tsx b/src/components/Widget/inputs.tsx index 57442d9aaf..0a2b746f19 100644 --- a/src/components/Widget/inputs.tsx +++ b/src/components/Widget/inputs.tsx @@ -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, } })