diff options
Customize Gas connected to state
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 86ef4b4b4..b0ef7d0a3 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -133,6 +133,10 @@ var actions = { // send screen estimateGas, getGasPrice, + UPDATE_GAS_LIMIT: 'UPDATE_GAS_LIMIT', + UPDATE_GAS_PRICE: 'UPDATE_GAS_PRICE', + updateGasLimit, + updateGasPrice, // app messages confirmSeedWords: confirmSeedWords, showAccountDetail: showAccountDetail, @@ -463,12 +467,20 @@ function estimateGas (params = {}) { return reject(err) } dispatch(actions.hideWarning()) + dispatch(actions.updateGasLimit(data)) return resolve(data) }) }) } } +function updateGasLimit (gasLimit) { + return { + type: actions.UPDATE_GAS_LIMIT, + value: gasLimit, + } +} + function getGasPrice () { return (dispatch) => { return new Promise((resolve, reject) => { @@ -478,12 +490,20 @@ function getGasPrice () { return reject(err) } dispatch(actions.hideWarning()) + dispatch(actions.updateGasPrice(data)) return resolve(data) }) }) } } +function updateGasPrice (gasPrice) { + return { + type: actions.UPDATE_GAS_PRICE, + value: gasPrice, + } +} + function sendTx (txData) { log.info(`actions - sendTx: ${JSON.stringify(txData.txParams)}`) return (dispatch) => { |