diff --git a/ui/components/app/advanced-gas-controls/advanced-gas-controls.component.js b/ui/components/app/advanced-gas-controls/advanced-gas-controls.component.js index 667fa5e8a..b265c3109 100644 --- a/ui/components/app/advanced-gas-controls/advanced-gas-controls.component.js +++ b/ui/components/app/advanced-gas-controls/advanced-gas-controls.component.js @@ -25,6 +25,7 @@ export default function AdvancedGasControls({ maxFeeFiat, gasErrors, minimumGasLimit, + estimateToUse, }) { const t = useContext(I18nContext); const networkAndAccountSupport1559 = useSelector( @@ -35,7 +36,8 @@ export default function AdvancedGasControls({ getGasLoadingAnimationIsShowing, ); const disableFormFields = - isGasEstimatesLoading || isGasLoadingAnimationIsShowing; + estimateToUse !== 'custom' && + (isGasEstimatesLoading || isGasLoadingAnimationIsShowing); const showFeeMarketFields = networkAndAccountSupport1559 && @@ -141,4 +143,5 @@ AdvancedGasControls.propTypes = { maxFeeFiat: PropTypes.string, gasErrors: PropTypes.object, minimumGasLimit: PropTypes.string, + estimateToUse: PropTypes.bool, }; diff --git a/ui/components/app/edit-gas-display/edit-gas-display.component.js b/ui/components/app/edit-gas-display/edit-gas-display.component.js index d0552b2a2..9be26cd20 100644 --- a/ui/components/app/edit-gas-display/edit-gas-display.component.js +++ b/ui/components/app/edit-gas-display/edit-gas-display.component.js @@ -269,6 +269,7 @@ export default function EditGasDisplay({ gasErrors={gasErrors} onManualChange={onManualChange} minimumGasLimit={minimumGasLimit} + estimateToUse={estimateToUse} /> )} diff --git a/ui/components/app/edit-gas-popover/edit-gas-popover.component.js b/ui/components/app/edit-gas-popover/edit-gas-popover.component.js index c3768b6ea..22f9c9bb9 100644 --- a/ui/components/app/edit-gas-popover/edit-gas-popover.component.js +++ b/ui/components/app/edit-gas-popover/edit-gas-popover.component.js @@ -210,9 +210,9 @@ export default function EditGasPopover({ onClick={onSubmit} disabled={ hasGasErrors || - isGasEstimatesLoading || balanceError || - gasLoadingAnimationIsShowing + ((isGasEstimatesLoading || gasLoadingAnimationIsShowing) && + !estimateToUse === 'custom') } > {footerButtonText} diff --git a/ui/components/app/transaction-detail/transaction-detail.component.js b/ui/components/app/transaction-detail/transaction-detail.component.js index 2f12d89da..43b17074f 100644 --- a/ui/components/app/transaction-detail/transaction-detail.component.js +++ b/ui/components/app/transaction-detail/transaction-detail.component.js @@ -1,9 +1,5 @@ import React, { useContext } from 'react'; import PropTypes from 'prop-types'; -import { useSelector } from 'react-redux'; - -import { getIsGasEstimatesLoading } from '../../../ducks/metamask/metamask'; -import { getGasLoadingAnimationIsShowing } from '../../../ducks/app/app'; import { I18nContext } from '../../../contexts/i18n'; @@ -12,22 +8,13 @@ import LoadingHeartBeat from '../../ui/loading-heartbeat'; export default function TransactionDetail({ rows = [], onEdit }) { const t = useContext(I18nContext); - const isGasEstimatesLoading = useSelector(getIsGasEstimatesLoading); - const gasLoadingAnimationIsShowing = useSelector( - getGasLoadingAnimationIsShowing, - ); return (