aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/actions.js
diff options
context:
space:
mode:
authorFrankie <frankie.diamond@gmail.com>2017-08-18 01:29:09 +0800
committerGitHub <noreply@github.com>2017-08-18 01:29:08 +0800
commit5f9862c89e2357a26384e1b48ab34ba052e967a4 (patch)
tree1e6c020045a780070f894d6bbf7554d78da2ee63 /ui/app/actions.js
parent9b57c77cb8db1a76dd8ac4a6ef3fb9fd4531b127 (diff)
parentf684b53b69116ef6b9e2b0449956d8f59df56253 (diff)
downloadtangerine-wallet-browser-5f9862c89e2357a26384e1b48ab34ba052e967a4.tar
tangerine-wallet-browser-5f9862c89e2357a26384e1b48ab34ba052e967a4.tar.gz
tangerine-wallet-browser-5f9862c89e2357a26384e1b48ab34ba052e967a4.tar.bz2
tangerine-wallet-browser-5f9862c89e2357a26384e1b48ab34ba052e967a4.tar.lz
tangerine-wallet-browser-5f9862c89e2357a26384e1b48ab34ba052e967a4.tar.xz
tangerine-wallet-browser-5f9862c89e2357a26384e1b48ab34ba052e967a4.tar.zst
tangerine-wallet-browser-5f9862c89e2357a26384e1b48ab34ba052e967a4.zip
Merge pull request #1935 from MetaMask/i1091-ShowTxErrors
Transition home after tx errors
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r--ui/app/actions.js23
1 files changed, 5 insertions, 18 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index eafd04b4c..eebe65ba2 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -97,7 +97,6 @@ var actions = {
cancelMsg: cancelMsg,
signPersonalMsg,
cancelPersonalMsg,
- sendTx: sendTx,
signTx: signTx,
updateAndApproveTx,
cancelTx: cancelTx,
@@ -397,26 +396,13 @@ function signPersonalMsg (msgData) {
function signTx (txData) {
return (dispatch) => {
+ dispatch(actions.showLoadingIndication())
global.ethQuery.sendTransaction(txData, (err, data) => {
dispatch(actions.hideLoadingIndication())
- if (err) return dispatch(actions.displayWarning(err.message))
- dispatch(actions.hideWarning())
- })
- dispatch(this.showConfTxPage())
- }
-}
-
-function sendTx (txData) {
- log.info(`actions - sendTx: ${JSON.stringify(txData.txParams)}`)
- return (dispatch) => {
- log.debug(`actions calling background.approveTransaction`)
- background.approveTransaction(txData.id, (err) => {
- if (err) {
- dispatch(actions.txError(err))
- return log.error(err.message)
- }
- dispatch(actions.completedTx(txData.id))
+ if (err) dispatch(actions.displayWarning(err.message))
+ dispatch(this.goHome())
})
+ dispatch(actions.showConfTxPage())
}
}
@@ -428,6 +414,7 @@ function updateAndApproveTx (txData) {
dispatch(actions.hideLoadingIndication())
if (err) {
dispatch(actions.txError(err))
+ dispatch(actions.goHome())
return log.error(err.message)
}
dispatch(actions.completedTx(txData.id))