From b8b8ed6a34e9c3c281bf85f9ba04275f598a28fe Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Fri, 11 May 2018 14:41:24 +0200 Subject: [PATCH] fix: estimateGasPrice reload currentState instance --- src/js/actions/SendFormActions.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/actions/SendFormActions.js b/src/js/actions/SendFormActions.js index 2229a605..23132f73 100644 --- a/src/js/actions/SendFormActions.js +++ b/src/js/actions/SendFormActions.js @@ -758,7 +758,7 @@ const estimateGasPrice = (): AsyncAction => { const web3instance: ?Web3Instance = getState().web3.filter(w3 => w3.network === accountState.network)[0]; if (!web3instance) return; const web3 = web3instance.web3; - const currentState: State = getState().sendForm; + let currentState: State = getState().sendForm; const data: string = '0x' + (currentState.data.length % 2 === 0 ? currentState.data : '0' + currentState.data); const gasLimit = await estimateGas(web3instance.web3, { @@ -768,6 +768,8 @@ const estimateGasPrice = (): AsyncAction => { gasPrice: web3.toHex( EthereumjsUnits.convert(currentState.gasPrice, 'gwei', 'wei') ), }); + currentState = getState().sendForm; + dispatch({ type: SEND.GAS_LIMIT_CHANGE, state: {