mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Remove dead code related to the selectedFromToken variable in swaps/index.js (#10570)
This commit is contained in:
parent
3128d183e1
commit
325215fb5f
@ -15,7 +15,6 @@ import {
|
|||||||
getCurrentChainId,
|
getCurrentChainId,
|
||||||
} from '../../selectors/selectors';
|
} from '../../selectors/selectors';
|
||||||
import {
|
import {
|
||||||
getFromToken,
|
|
||||||
getQuotes,
|
getQuotes,
|
||||||
clearSwapsState,
|
clearSwapsState,
|
||||||
getTradeTxId,
|
getTradeTxId,
|
||||||
@ -44,7 +43,6 @@ import {
|
|||||||
import {
|
import {
|
||||||
ERROR_FETCHING_QUOTES,
|
ERROR_FETCHING_QUOTES,
|
||||||
QUOTES_NOT_AVAILABLE_ERROR,
|
QUOTES_NOT_AVAILABLE_ERROR,
|
||||||
ETH_SWAPS_TOKEN_OBJECT,
|
|
||||||
SWAP_FAILED_ERROR,
|
SWAP_FAILED_ERROR,
|
||||||
OFFLINE_FOR_MAINTENANCE,
|
OFFLINE_FOR_MAINTENANCE,
|
||||||
} from '../../helpers/constants/swaps';
|
} from '../../helpers/constants/swaps';
|
||||||
@ -62,7 +60,6 @@ import {
|
|||||||
getRpcPrefsForCurrentProvider,
|
getRpcPrefsForCurrentProvider,
|
||||||
} from '../../selectors';
|
} from '../../selectors';
|
||||||
import { useNewMetricEvent } from '../../hooks/useMetricEvent';
|
import { useNewMetricEvent } from '../../hooks/useMetricEvent';
|
||||||
import { getValueFromWeiHex } from '../../helpers/utils/conversions.util';
|
|
||||||
|
|
||||||
import FeatureToggledRoute from '../../helpers/higher-order-components/feature-toggled-route';
|
import FeatureToggledRoute from '../../helpers/higher-order-components/feature-toggled-route';
|
||||||
import { TRANSACTION_STATUSES } from '../../../../shared/constants/transaction';
|
import { TRANSACTION_STATUSES } from '../../../../shared/constants/transaction';
|
||||||
@ -88,8 +85,7 @@ export default function Swap() {
|
|||||||
const isLoadingQuotesRoute = pathname === LOADING_QUOTES_ROUTE;
|
const isLoadingQuotesRoute = pathname === LOADING_QUOTES_ROUTE;
|
||||||
|
|
||||||
const fetchParams = useSelector(getFetchParams);
|
const fetchParams = useSelector(getFetchParams);
|
||||||
const { sourceTokenInfo = {}, destinationTokenInfo = {} } =
|
const { destinationTokenInfo = {} } = fetchParams?.metaData || {};
|
||||||
fetchParams?.metaData || {};
|
|
||||||
|
|
||||||
const [inputValue, setInputValue] = useState(fetchParams?.value || '');
|
const [inputValue, setInputValue] = useState(fetchParams?.value || '');
|
||||||
const [maxSlippage, setMaxSlippage] = useState(fetchParams?.slippage || 2);
|
const [maxSlippage, setMaxSlippage] = useState(fetchParams?.slippage || 2);
|
||||||
@ -111,20 +107,7 @@ export default function Swap() {
|
|||||||
balance: ethBalance,
|
balance: ethBalance,
|
||||||
address: selectedAccountAddress,
|
address: selectedAccountAddress,
|
||||||
} = selectedAccount;
|
} = selectedAccount;
|
||||||
const fetchParamsFromToken =
|
|
||||||
sourceTokenInfo?.symbol === 'ETH'
|
|
||||||
? {
|
|
||||||
...ETH_SWAPS_TOKEN_OBJECT,
|
|
||||||
string: getValueFromWeiHex({
|
|
||||||
value: ethBalance,
|
|
||||||
numberOfDecimals: 4,
|
|
||||||
toDenomination: 'ETH',
|
|
||||||
}),
|
|
||||||
balance: ethBalance,
|
|
||||||
}
|
|
||||||
: sourceTokenInfo;
|
|
||||||
const selectedFromToken =
|
|
||||||
useSelector(getFromToken) || fetchParamsFromToken || {};
|
|
||||||
const { destinationTokenAddedForSwap } = fetchParams || {};
|
const { destinationTokenAddedForSwap } = fetchParams || {};
|
||||||
|
|
||||||
const approveTxData =
|
const approveTxData =
|
||||||
@ -299,7 +282,6 @@ export default function Swap() {
|
|||||||
return (
|
return (
|
||||||
<BuildQuote
|
<BuildQuote
|
||||||
inputValue={inputValue}
|
inputValue={inputValue}
|
||||||
selectedFromToken={selectedFromToken}
|
|
||||||
onInputChange={onInputChange}
|
onInputChange={onInputChange}
|
||||||
ethBalance={ethBalance}
|
ethBalance={ethBalance}
|
||||||
setMaxSlippage={setMaxSlippage}
|
setMaxSlippage={setMaxSlippage}
|
||||||
|
Loading…
Reference in New Issue
Block a user