From a944b9287e66c26e61b163f79ec556d8b6b66692 Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Wed, 21 Nov 2018 14:25:55 +0100 Subject: [PATCH] SendFormActions: setDefaultGesLimit - token or coin value fix --- src/actions/SendFormActions.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/actions/SendFormActions.js b/src/actions/SendFormActions.js index cdea6602..d7a71825 100644 --- a/src/actions/SendFormActions.js +++ b/src/actions/SendFormActions.js @@ -389,14 +389,17 @@ export const setDefaultGasLimit = (): ThunkAction => (dispatch: Dispatch, getSta const { network } = getState().selectedAccount; if (!network) return; + const isToken = state.currency !== state.networkSymbol; + const gasLimit = isToken ? network.defaultGasLimitTokens.toString() : network.defaultGasLimit.toString(); + dispatch({ type: SEND.CHANGE, state: { ...state, calculatingGasLimit: false, untouched: false, - touched: { ...state.touched, gasLimit: true }, - gasLimit: network.defaultGasLimit.toString(), + touched: { ...state.touched, gasLimit: false }, + gasLimit, }, }); };