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 ( return (
<Button <Button
onClick={() => onClick={() =>
handleGasPriceSelection( handleGasPriceSelection({
priceInHexWei, gasPrice: priceInHexWei,
renderableGasInfo.gasEstimateType, gasEstimateType: renderableGasInfo.gasEstimateType,
) })
} }
key={`gas-price-button-${index}`} key={`gas-price-button-${index}`}
> >

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

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

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

Loading…
Cancel
Save