diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-02-28 10:26:04 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-02-28 10:26:04 +0800 |
commit | d844769c926ebc0c43363b4228892e7b2e4e74ee (patch) | |
tree | bbe76ad4d00fef094902ceba2a6142becc875a9c /ui | |
parent | 1eb4a5d62c4fdc8a16c7913c9027e0b11c01da52 (diff) | |
download | tangerine-wallet-browser-d844769c926ebc0c43363b4228892e7b2e4e74ee.tar tangerine-wallet-browser-d844769c926ebc0c43363b4228892e7b2e4e74ee.tar.gz tangerine-wallet-browser-d844769c926ebc0c43363b4228892e7b2e4e74ee.tar.bz2 tangerine-wallet-browser-d844769c926ebc0c43363b4228892e7b2e4e74ee.tar.lz tangerine-wallet-browser-d844769c926ebc0c43363b4228892e7b2e4e74ee.tar.xz tangerine-wallet-browser-d844769c926ebc0c43363b4228892e7b2e4e74ee.tar.zst tangerine-wallet-browser-d844769c926ebc0c43363b4228892e7b2e4e74ee.zip |
Add action for updating and approving a tx in one action
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/actions.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 89a4fadfa..b9169a106 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -94,6 +94,7 @@ var actions = { cancelPersonalMsg, sendTx: sendTx, signTx: signTx, + updateAndApproveTx, cancelTx: cancelTx, completedTx: completedTx, txError: txError, @@ -415,6 +416,20 @@ function sendTx (txData) { } } +function updateAndApproveTx (txData) { + log.info('actions: updateAndApproveTx') + return (dispatch) => { + log.debug(`actions calling background.updateAndApproveTx`) + background.updateAndApproveTransaction(txData, (err) => { + if (err) { + dispatch(actions.txError(err)) + return console.error(err.message) + } + dispatch(actions.completedTx(txData.id)) + }) + } +} + function completedTx (id) { return { type: actions.COMPLETED_TX, |