From 148e415fe85f11b4817abfe5cb8438aed1ac29d1 Mon Sep 17 00:00:00 2001 From: Eugene Sokovikov Date: Mon, 23 May 2022 17:59:49 +0400 Subject: [PATCH] fix: handle non existing inputCurrency from url #3056 (#3857) - fix: handle non existing inputCurrency from url oppening an url swap?inputCurrency=not_existing_address cause a state where you are not able to change input currency --- src/pages/Swap/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Swap/index.tsx b/src/pages/Swap/index.tsx index c1e83603d6..5c9facb030 100644 --- a/src/pages/Swap/index.tsx +++ b/src/pages/Swap/index.tsx @@ -426,7 +426,7 @@ export default function Swap({ history }: RouteComponentProps) { } value={formattedAmounts[Field.INPUT]} showMaxButton={showMaxButton} - currency={currencies[Field.INPUT]} + currency={currencies[Field.INPUT] ?? null} onUserInput={handleTypeInput} onMax={handleMaxInput} fiatValue={fiatValueInput ?? undefined} @@ -454,7 +454,7 @@ export default function Swap({ history }: RouteComponentProps) { hideBalance={false} fiatValue={fiatValueOutput ?? undefined} priceImpact={priceImpact} - currency={currencies[Field.OUTPUT]} + currency={currencies[Field.OUTPUT] ?? null} onCurrencySelect={handleOutputSelect} otherCurrency={currencies[Field.INPUT]} showCommonBases={true}