diff --git a/ui/app/ducks/swaps/swaps.js b/ui/app/ducks/swaps/swaps.js index c58272827..206d69619 100644 --- a/ui/app/ducks/swaps/swaps.js +++ b/ui/app/ducks/swaps/swaps.js @@ -50,7 +50,6 @@ const initialState = { quotesFetchStartTime: null, topAssets: {}, toToken: null, - metamaskFeeAmount: null, } const slice = createSlice({ @@ -89,9 +88,6 @@ const slice = createSlice({ setToToken: (state, action) => { state.toToken = action.payload }, - setMetamaskFeeAmount: (state, action) => { - state.metamaskFeeAmount = action.payload - }, }, }) @@ -111,8 +107,6 @@ export const getTopAssets = (state) => state.swaps.topAssets export const getToToken = (state) => state.swaps.toToken -export const getMetaMaskFeeAmount = (state) => state.swaps.metamaskFeeAmount - export const getFetchingQuotes = (state) => state.swaps.fetchingQuotes export const getQuotesFetchStartTime = (state) => state.swaps.quotesFetchStartTime @@ -200,7 +194,6 @@ const { setQuotesFetchStartTime, setTopAssets, setToToken, - setMetamaskFeeAmount, } = actions export { @@ -212,7 +205,6 @@ export { setQuotesFetchStartTime as setSwapQuotesFetchStartTime, setTopAssets, setToToken as setSwapToToken, - setMetamaskFeeAmount, } export const navigateBackToBuildQuote = (history) => { diff --git a/ui/app/pages/swaps/index.js b/ui/app/pages/swaps/index.js index ea38f53b7..9b6396f6f 100644 --- a/ui/app/pages/swaps/index.js +++ b/ui/app/pages/swaps/index.js @@ -20,7 +20,6 @@ import { getAggregatorMetadata, getBackgroundSwapRouteState, getSwapsErrorKey, - setMetamaskFeeAmount, getSwapsFeatureLiveness, prepareToLeaveSwaps, fetchAndSetSwapsGasPriceInfo, @@ -49,7 +48,7 @@ import { useNewMetricEvent } from '../../hooks/useMetricEvent' import { getValueFromWeiHex } from '../../helpers/utils/conversions.util' import FeatureToggledRoute from '../../helpers/higher-order-components/feature-toggled-route' -import { fetchTokens, fetchTopAssets, getSwapsTokensReceivedFromTxMeta, fetchAggregatorMetadata, fetchMetaMaskFeeAmount } from './swaps.util' +import { fetchTokens, fetchTopAssets, getSwapsTokensReceivedFromTxMeta, fetchAggregatorMetadata } from './swaps.util' import AwaitingSwap from './awaiting-swap' import LoadingQuote from './loading-swaps-quotes' import BuildQuote from './build-quote' @@ -155,11 +154,6 @@ export default function Swap () { dispatch(setAggregatorMetadata(newAggregatorMetadata)) }) - fetchMetaMaskFeeAmount() - .then((metaMaskFeeAmount) => { - dispatch(setMetamaskFeeAmount(metaMaskFeeAmount)) - }) - dispatch(resetCustomGasState()) dispatch(fetchAndSetSwapsGasPriceInfo()) diff --git a/ui/app/pages/swaps/select-quote-popover/quote-details/quote-details.js b/ui/app/pages/swaps/select-quote-popover/quote-details/quote-details.js index bff69cbb5..5e8d7d8e6 100644 --- a/ui/app/pages/swaps/select-quote-popover/quote-details/quote-details.js +++ b/ui/app/pages/swaps/select-quote-popover/quote-details/quote-details.js @@ -1,8 +1,6 @@ import React, { useContext } from 'react' import PropTypes from 'prop-types' -import { useSelector } from 'react-redux' import { I18nContext } from '../../../../contexts/i18n' -import { getMetaMaskFeeAmount } from '../../../../ducks/swaps/swaps' import InfoTooltip from '../../../../components/ui/info-tooltip' import ExchangeRateDisplay from '../../exchange-rate-display' @@ -16,9 +14,9 @@ const QuoteDetails = ({ minimumAmountReceived, feeInEth, networkFees, + metaMaskFee, }) => { const t = useContext(I18nContext) - const metaMaskFee = useSelector(getMetaMaskFeeAmount) return (