1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fix setGasPrice dispatch function params

This commit is contained in:
Erik Marks 2020-11-12 14:57:29 -08:00
parent 64657efdef
commit bb81ac7cd6
4 changed files with 13 additions and 13 deletions

View File

@ -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}`}
>

View File

@ -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)

View File

@ -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) => {

View File

@ -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)
},
}}
/>