Skip to content

Commit

Permalink
fix: disable swap chains when they are not selected
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed Jun 1, 2022
1 parent f045008 commit 8531863
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ export const ReverseTokensButton: React.FC<{ vertical?: boolean }> = ({
SwapFormKey.ToChain,
SwapFormKey.ToToken,
]);
setValue(SwapFormKey.FromChain, toChain);
setValue(SwapFormKey.FromToken, toToken);
setValue(SwapFormKey.ToChain, fromChain);
setValue(SwapFormKey.ToToken, fromToken);
setValue(SwapFormKey.FromAmount, '');
if (fromChain && fromToken && toChain && toToken) {
setValue(SwapFormKey.FromAmount, '');
setValue(SwapFormKey.FromChain, toChain);
setValue(SwapFormKey.FromToken, toToken);
setValue(SwapFormKey.ToChain, fromChain);
setValue(SwapFormKey.ToToken, fromToken);
}
};
return (
<IconButton
Expand Down

0 comments on commit 8531863

Please sign in to comment.