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

View File

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

View File

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

View File

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