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
This commit is contained in:
Eugene Sokovikov 2022-05-23 17:59:49 +04:00 committed by GitHub
parent fd964c5b74
commit 148e415fe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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}