Skip to content

Commit

Permalink
Revert "Merge pull request #807 from secretkeylabs/eng-5883" (#813)
Browse files Browse the repository at this point in the history
This reverts commit 3b3e28c, reversing
changes made to c87afef.
  • Loading branch information
jordankzf authored Dec 6, 2024
1 parent 3b3e28c commit 91c71f0
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions src/app/screens/swap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import AmountInput from './components/amountInput';
import PsbtConfirmation from './components/psbtConfirmation/psbtConfirmation';
import RouteItem from './components/routeItem';
import TokenFromBottomSheet from './components/tokenFromBottomSheet';
import useFromTokens from './components/tokenFromBottomSheet/useFromTokens';
import TokenToBottomSheet from './components/tokenToBottomSheet';
import trackSwapMixPanel from './mixpanel';
import QuoteSummary from './quoteSummary';
Expand Down Expand Up @@ -118,7 +117,6 @@ export default function SwapScreen() {
const [hasQuoteError, setHasQuoteError] = useState(false);
const [orderInfo, setOrderInfo] = useState<OrderInfo | undefined>();
const [stxOrderInfo, setStxOrderInfo] = useState<StxOrderInfo | undefined>();
const fromTokens = useFromTokens();

const [selectedUtxos, setSelectedUtxos] = useState<Omit<MarketUtxo, 'token'>[]>();
const [utxoProviderSendAmount, setUtxoProviderSendAmount] = useState<string | undefined>();
Expand Down Expand Up @@ -207,24 +205,11 @@ export default function SwapScreen() {
if (isSwapRouteDisabled) {
return;
}

setInputError('');
setAmount('');
setHasQuoteError(false);
const newFrom = toToken;
const newTo = fromToken;
setFromToken(newFrom);
setToToken(newTo);

if (newFrom?.principal !== 'BTC') {
const matchingToken = fromTokens.find(
(token) => token.principal !== 'BTC' && token.principal === newFrom?.principal,
);

if (matchingToken) {
setFromToken(matchingToken);
}
}
setFromToken(toToken);
setToToken(fromToken);
};

const onChangeToToken = (token: Token) => {
Expand Down

0 comments on commit 91c71f0

Please sign in to comment.