aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/actions.js
diff options
context:
space:
mode:
authorbrunobar79 <brunobar79@gmail.com>2018-07-02 05:41:34 +0800
committerbrunobar79 <brunobar79@gmail.com>2018-07-02 05:41:34 +0800
commit1494cc5e6c5943095c89e3b243b0a6152876e72c (patch)
treee34e74e79e8d41ce5903cc8d6eedf5caa19bc354 /ui/app/actions.js
parent6e563acd93cbaf20fb233a267104fc6af3384287 (diff)
parentb2e64f24ecbc9e309869e678254cf755ffe11b40 (diff)
downloadtangerine-wallet-browser-1494cc5e6c5943095c89e3b243b0a6152876e72c.tar.gz
tangerine-wallet-browser-1494cc5e6c5943095c89e3b243b0a6152876e72c.tar.zst
tangerine-wallet-browser-1494cc5e6c5943095c89e3b243b0a6152876e72c.zip
fix merge conflicts
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r--ui/app/actions.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 758696203..c822ef3ee 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -177,6 +177,8 @@ var actions = {
CLEAR_SEND: 'CLEAR_SEND',
OPEN_FROM_DROPDOWN: 'OPEN_FROM_DROPDOWN',
CLOSE_FROM_DROPDOWN: 'CLOSE_FROM_DROPDOWN',
+ GAS_LOADING_STARTED: 'GAS_LOADING_STARTED',
+ GAS_LOADING_FINISHED: 'GAS_LOADING_FINISHED',
setGasLimit,
setGasPrice,
updateGasData,
@@ -192,6 +194,8 @@ var actions = {
updateSendErrors,
clearSend,
setSelectedAddress,
+ gasLoadingStarted,
+ gasLoadingFinished,
// app messages
confirmSeedWords: confirmSeedWords,
showAccountDetail: showAccountDetail,
@@ -782,8 +786,9 @@ function updateGasData ({
to,
value,
}) {
- const estimatedGasPrice = estimateGasPriceFromRecentBlocks(recentBlocks)
return (dispatch) => {
+ dispatch(actions.gasLoadingStarted())
+ const estimatedGasPrice = estimateGasPriceFromRecentBlocks(recentBlocks)
return Promise.all([
Promise.resolve(estimatedGasPrice),
estimateGas({
@@ -804,14 +809,28 @@ function updateGasData ({
.then((gasEstimate) => {
dispatch(actions.setGasTotal(gasEstimate))
dispatch(updateSendErrors({ gasLoadingError: null }))
+ dispatch(actions.gasLoadingFinished())
})
.catch(err => {
log.error(err)
dispatch(updateSendErrors({ gasLoadingError: 'gasLoadingError' }))
+ dispatch(actions.gasLoadingFinished())
})
}
}
+function gasLoadingStarted () {
+ return {
+ type: actions.GAS_LOADING_STARTED,
+ }
+}
+
+function gasLoadingFinished () {
+ return {
+ type: actions.GAS_LOADING_FINISHED,
+ }
+}
+
function updateSendTokenBalance ({
selectedToken,
tokenContract,