diff options
author | Dan <danjm.com@gmail.com> | 2017-10-13 00:42:14 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-10-16 11:09:05 +0800 |
commit | a9244f5e426d6572ef135e07ab75a49c00e84942 (patch) | |
tree | 7aa7e1d98711ffbb2e27eb068b086c13238f421f /ui/app/actions.js | |
parent | a59972dcabc56c3d92f09ba1b88a2ded70ce8c34 (diff) | |
download | tangerine-wallet-browser-a9244f5e426d6572ef135e07ab75a49c00e84942.tar.gz tangerine-wallet-browser-a9244f5e426d6572ef135e07ab75a49c00e84942.tar.zst tangerine-wallet-browser-a9244f5e426d6572ef135e07ab75a49c00e84942.zip |
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) => { |