From 6ff580584a74c6d85f54ce7cfc500db822904957 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 6 Dec 2017 22:20:11 -0500 Subject: Add retry background method and action --- ui/app/actions.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ui/app/actions.js') diff --git a/ui/app/actions.js b/ui/app/actions.js index 04fd35b20..2ab68b62d 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -168,6 +168,7 @@ var actions = { callBackgroundThenUpdate, forceUpdateMetamaskState, + retryTransaction, } module.exports = actions @@ -759,6 +760,11 @@ function markAccountsFound () { return callBackgroundThenUpdate(background.markAccountsFound) } +function retryTransaction () { + log.debug(`background.retryTransaction`) + return callBackgroundThenUpdate(background.retryTransaction) +} + // // config // -- cgit From 97abbc5cbe97157304f27f0f20336b543de62428 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 6 Dec 2017 22:55:47 -0500 Subject: Fix action --- ui/app/actions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/app/actions.js') diff --git a/ui/app/actions.js b/ui/app/actions.js index 2ab68b62d..35eb4b0c8 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -760,9 +760,9 @@ function markAccountsFound () { return callBackgroundThenUpdate(background.markAccountsFound) } -function retryTransaction () { +function retryTransaction (txId) { log.debug(`background.retryTransaction`) - return callBackgroundThenUpdate(background.retryTransaction) + return callBackgroundThenUpdate(background.retryTransaction, txId) } // -- cgit From 81fb9db1bcd08fb4e92d87d0c0905cb02dac63c2 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 6 Dec 2017 23:09:32 -0500 Subject: View tx after editing state to unconfirmed --- ui/app/actions.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'ui/app/actions.js') diff --git a/ui/app/actions.js b/ui/app/actions.js index 35eb4b0c8..0dc4f3832 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -762,7 +762,15 @@ function markAccountsFound () { function retryTransaction (txId) { log.debug(`background.retryTransaction`) - return callBackgroundThenUpdate(background.retryTransaction, txId) + return (dispatch) => { + background.retryTransaction(txId, (err) => { + if (err) { + return dispatch(actions.displayWarning(err.message)) + } + forceUpdateMetamaskState(dispatch) + dispatch(actions.viewPendingTx(txId)) + }) + } } // -- cgit From 31564e0a86072ae2b49923dcf28983075308c432 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 6 Dec 2017 23:20:15 -0500 Subject: Fix retry action --- ui/app/actions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/app/actions.js') diff --git a/ui/app/actions.js b/ui/app/actions.js index 0dc4f3832..52ea899aa 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -763,11 +763,11 @@ function markAccountsFound () { function retryTransaction (txId) { log.debug(`background.retryTransaction`) return (dispatch) => { - background.retryTransaction(txId, (err) => { + background.retryTransaction(txId, (err, newState) => { if (err) { return dispatch(actions.displayWarning(err.message)) } - forceUpdateMetamaskState(dispatch) + dispatch(actions.updateMetamaskState(newState)) dispatch(actions.viewPendingTx(txId)) }) } -- cgit