Fix setGasPrice dispatch function params

feature/default_network_editable
Erik Marks 4 years ago
parent 64657efdef
commit bb81ac7cd6
  1. 8
      ui/app/components/app/gas-customization/gas-price-button-group/gas-price-button-group.component.js
  2. 6
      ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js
  3. 8
      ui/app/pages/send/send-content/send-gas-row/send-gas-row.container.js
  4. 4
      ui/app/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.component.js

@ -94,10 +94,10 @@ export default class GasPriceButtonGroup extends Component {
return (
<Button
onClick={() =>
handleGasPriceSelection(
priceInHexWei,
renderableGasInfo.gasEstimateType,
)
handleGasPriceSelection({
gasPrice: priceInHexWei,
gasEstimateType: renderableGasInfo.gasEstimateType,
})
}
key={`gas-price-button-${index}`}
>

@ -101,7 +101,7 @@ export default class SendGasRow extends Component {
className="gas-price-button-group--small"
showCheck={false}
{...gasPriceButtonGroupProps}
handleGasPriceSelection={async (...args) => {
handleGasPriceSelection={async (opts) => {
metricsEvent({
eventOpts: {
category: 'Transactions',
@ -109,7 +109,7 @@ export default class SendGasRow extends Component {
name: 'Changed Gas Button',
},
})
await gasPriceButtonGroupProps.handleGasPriceSelection(...args)
await gasPriceButtonGroupProps.handleGasPriceSelection(opts)
if (maxModeOn) {
this.setMaxAmount()
}
@ -134,7 +134,7 @@ export default class SendGasRow extends Component {
<div>
<AdvancedGasInputs
updateCustomGasPrice={(newGasPrice) =>
setGasPrice(newGasPrice, gasLimit)
setGasPrice({ gasPrice: newGasPrice, gasLimit })
}
updateCustomGasLimit={(newGasLimit) =>
setGasLimit(newGasLimit, gasPrice)

@ -89,11 +89,11 @@ function mapDispatchToProps(dispatch) {
return {
showCustomizeGasModal: () =>
dispatch(showModal({ name: 'CUSTOMIZE_GAS', hideBasic: true })),
setGasPrice: (newPrice, gasLimit) => {
dispatch(setGasPrice(newPrice))
dispatch(setCustomGasPrice(newPrice))
setGasPrice: ({ gasPrice, gasLimit }) => {
dispatch(setGasPrice(gasPrice))
dispatch(setCustomGasPrice(gasPrice))
if (gasLimit) {
dispatch(setGasTotal(calcGasTotal(gasLimit, newPrice)))
dispatch(setGasTotal(calcGasTotal(gasLimit, gasPrice)))
}
},
setGasLimit: (newLimit, gasPrice) => {

@ -61,9 +61,9 @@ export default class GasModalPageContainer extends Component {
<BasicTabContent
gasPriceButtonGroupProps={{
...gasPriceButtonGroupProps,
handleGasPriceSelection: (gasPriceInHexWei, gasEstimateType) => {
handleGasPriceSelection: ({ gasPrice, gasEstimateType }) => {
this.setGasSpeedType(gasEstimateType)
this.props.setSwapsCustomizationModalPrice(gasPriceInHexWei)
this.props.setSwapsCustomizationModalPrice(gasPrice)
},
}}
/>

Loading…
Cancel
Save