diff options
author | Alexander Tseung <alextsg@users.noreply.github.com> | 2018-05-30 01:23:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-30 01:23:06 +0800 |
commit | 41e38fe5530bce1fd7d19060774179a215087fac (patch) | |
tree | 834429dd2be6ccf7d7c345965e74f50a27bbcf1a /ui/app/actions.js | |
parent | e3c9629130901c2268350a58eb18f2ab9f6ab72e (diff) | |
download | tangerine-wallet-browser-41e38fe5530bce1fd7d19060774179a215087fac.tar tangerine-wallet-browser-41e38fe5530bce1fd7d19060774179a215087fac.tar.gz tangerine-wallet-browser-41e38fe5530bce1fd7d19060774179a215087fac.tar.bz2 tangerine-wallet-browser-41e38fe5530bce1fd7d19060774179a215087fac.tar.lz tangerine-wallet-browser-41e38fe5530bce1fd7d19060774179a215087fac.tar.xz tangerine-wallet-browser-41e38fe5530bce1fd7d19060774179a215087fac.tar.zst tangerine-wallet-browser-41e38fe5530bce1fd7d19060774179a215087fac.zip |
Add notification for dropped retry transactions (#4363)
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 894e31fde..649f740e9 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -1397,16 +1397,24 @@ function markAccountsFound () { function retryTransaction (txId) { log.debug(`background.retryTransaction`) + let newTxId + return (dispatch) => { - background.retryTransaction(txId, (err, newState) => { - if (err) { - return dispatch(actions.displayWarning(err.message)) - } - const { selectedAddressTxList } = newState - const { id: newTxId } = selectedAddressTxList[selectedAddressTxList.length - 1] - dispatch(actions.updateMetamaskState(newState)) - dispatch(actions.viewPendingTx(newTxId)) + return new Promise((resolve, reject) => { + background.retryTransaction(txId, (err, newState) => { + if (err) { + dispatch(actions.displayWarning(err.message)) + reject(err) + } + + const { selectedAddressTxList } = newState + const { id } = selectedAddressTxList[selectedAddressTxList.length - 1] + newTxId = id + resolve(newState) + }) }) + .then(newState => dispatch(actions.updateMetamaskState(newState))) + .then(() => newTxId) } } |