From 109e46c95f9bb8f34f2e372064f32f6f0490ee35 Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Tue, 2 Aug 2022 16:56:35 -0500 Subject: [PATCH] remove unnecessary usage of renderableGasButton logic (#15422) --- .../send/send-footer/send-footer.component.js | 11 +---------- .../send/send-footer/send-footer.container.js | 18 ------------------ 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/ui/pages/send/send-footer/send-footer.component.js b/ui/pages/send/send-footer/send-footer.component.js index 0e0c03ae4..87dd68295 100644 --- a/ui/pages/send/send-footer/send-footer.component.js +++ b/ui/pages/send/send-footer/send-footer.component.js @@ -20,7 +20,6 @@ export default class SendFooter extends Component { toAccounts: PropTypes.array, sendStage: PropTypes.string, sendErrors: PropTypes.object, - gasEstimateType: PropTypes.string, mostRecentOverviewPage: PropTypes.string.isRequired, cancelTx: PropTypes.func, draftTransactionID: PropTypes.string, @@ -53,14 +52,7 @@ export default class SendFooter extends Component { async onSubmit(event) { event.preventDefault(); - const { - addToAddressBookIfNew, - sign, - to, - toAccounts, - history, - gasEstimateType, - } = this.props; + const { addToAddressBookIfNew, sign, to, toAccounts, history } = this.props; const { trackEvent } = this.context; // TODO: add nickname functionality @@ -74,7 +66,6 @@ export default class SendFooter extends Component { properties: { action: 'Edit Screen', legacy_event: true, - gasChanged: gasEstimateType, }, }); history.push(CONFIRM_TRANSACTION_ROUTE); diff --git a/ui/pages/send/send-footer/send-footer.container.js b/ui/pages/send/send-footer/send-footer.container.js index 3ec6ddbc1..7c36ab9f3 100644 --- a/ui/pages/send/send-footer/send-footer.container.js +++ b/ui/pages/send/send-footer/send-footer.container.js @@ -1,12 +1,7 @@ import { connect } from 'react-redux'; import { addToAddressBook, cancelTx } from '../../../store/actions'; -import { - getRenderableEstimateDataForSmallButtonsFromGWEI, - getDefaultActiveButtonIndex, -} from '../../../selectors'; import { resetSendState, - getGasPrice, getSendStage, getSendTo, getSendErrors, @@ -17,7 +12,6 @@ import { import { getMostRecentOverviewPage } from '../../../ducks/history/history'; import { addHexPrefix } from '../../../../app/scripts/lib/util'; import { getSendToAccounts } from '../../../ducks/metamask/metamask'; -import { CUSTOM_GAS_ESTIMATE } from '../../../../shared/constants/gas'; import SendFooter from './send-footer.component'; export default connect(mapStateToProps, mapDispatchToProps)(SendFooter); @@ -31,17 +25,6 @@ function addressIsNew(toAccounts, newAddress) { } function mapStateToProps(state) { - const gasButtonInfo = getRenderableEstimateDataForSmallButtonsFromGWEI(state); - const gasPrice = getGasPrice(state); - const activeButtonIndex = getDefaultActiveButtonIndex( - gasButtonInfo, - gasPrice, - ); - const gasEstimateType = - activeButtonIndex >= 0 - ? gasButtonInfo[activeButtonIndex].gasEstimateType - : CUSTOM_GAS_ESTIMATE; - return { disabled: isSendFormInvalid(state), to: getSendTo(state), @@ -49,7 +32,6 @@ function mapStateToProps(state) { sendStage: getSendStage(state), sendErrors: getSendErrors(state), draftTransactionID: getDraftTransactionID(state), - gasEstimateType, mostRecentOverviewPage: getMostRecentOverviewPage(state), }; }