diff options
author | Dan J Miller <danjm.com@gmail.com> | 2019-03-26 00:19:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-26 00:19:23 +0800 |
commit | 69f7968c70caaae8a070b4cf238b2832db103f2c (patch) | |
tree | 7f3f6fdb6afba9f97322e3238d4a2c96986a82ce /ui/app/store | |
parent | 961ad267df93cbb3fc61d0a999bd78f132c877b1 (diff) | |
download | tangerine-wallet-browser-69f7968c70caaae8a070b4cf238b2832db103f2c.tar tangerine-wallet-browser-69f7968c70caaae8a070b4cf238b2832db103f2c.tar.gz tangerine-wallet-browser-69f7968c70caaae8a070b4cf238b2832db103f2c.tar.bz2 tangerine-wallet-browser-69f7968c70caaae8a070b4cf238b2832db103f2c.tar.lz tangerine-wallet-browser-69f7968c70caaae8a070b4cf238b2832db103f2c.tar.xz tangerine-wallet-browser-69f7968c70caaae8a070b4cf238b2832db103f2c.tar.zst tangerine-wallet-browser-69f7968c70caaae8a070b4cf238b2832db103f2c.zip |
Close transaction on close of notification window (#6340)
Diffstat (limited to 'ui/app/store')
-rw-r--r-- | ui/app/store/actions.js | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index b99b051cb..b2aa28c93 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -902,6 +902,7 @@ function signMsg (msgData) { log.debug('action - signMsg') return (dispatch, getState) => { dispatch(actions.showLoadingIndication()) + window.onbeforeunload = null return new Promise((resolve, reject) => { log.debug(`actions calling background.signMessage`) @@ -933,7 +934,7 @@ function signPersonalMsg (msgData) { log.debug('action - signPersonalMsg') return (dispatch, getState) => { dispatch(actions.showLoadingIndication()) - + window.onbeforeunload = null return new Promise((resolve, reject) => { log.debug(`actions calling background.signPersonalMessage`) background.signPersonalMessage(msgData, (err, newState) => { @@ -964,7 +965,7 @@ function signTypedMsg (msgData) { log.debug('action - signTypedMsg') return (dispatch, getState) => { dispatch(actions.showLoadingIndication()) - + window.onbeforeunload = null return new Promise((resolve, reject) => { log.debug(`actions calling background.signTypedMessage`) background.signTypedMessage(msgData, (err, newState) => { @@ -1168,6 +1169,7 @@ function sendTx (txData) { log.info(`actions - sendTx: ${JSON.stringify(txData.txParams)}`) return (dispatch, getState) => { log.debug(`actions calling background.approveTransaction`) + window.onbeforeunload = null background.approveTransaction(txData.id, (err) => { if (err) { dispatch(actions.txError(err)) @@ -1230,7 +1232,7 @@ function updateAndApproveTx (txData) { return (dispatch, getState) => { log.debug(`actions calling background.updateAndApproveTx`) dispatch(actions.showLoadingIndication()) - + window.onbeforeunload = null return new Promise((resolve, reject) => { background.updateAndApproveTransaction(txData, err => { dispatch(actions.updateTransactionParams(txData.id, txData.txParams)) @@ -1292,7 +1294,7 @@ function txError (err) { function cancelMsg (msgData) { return (dispatch, getState) => { dispatch(actions.showLoadingIndication()) - + window.onbeforeunload = null return new Promise((resolve, reject) => { log.debug(`background.cancelMessage`) background.cancelMessage(msgData.id, (err, newState) => { @@ -1319,7 +1321,7 @@ function cancelMsg (msgData) { function cancelPersonalMsg (msgData) { return (dispatch, getState) => { dispatch(actions.showLoadingIndication()) - + window.onbeforeunload = null return new Promise((resolve, reject) => { const id = msgData.id background.cancelPersonalMessage(id, (err, newState) => { @@ -1346,7 +1348,7 @@ function cancelPersonalMsg (msgData) { function cancelTypedMsg (msgData) { return (dispatch, getState) => { dispatch(actions.showLoadingIndication()) - + window.onbeforeunload = null return new Promise((resolve, reject) => { const id = msgData.id background.cancelTypedMessage(id, (err, newState) => { @@ -1374,7 +1376,7 @@ function cancelTx (txData) { return (dispatch, getState) => { log.debug(`background.cancelTransaction`) dispatch(actions.showLoadingIndication()) - + window.onbeforeunload = null return new Promise((resolve, reject) => { background.cancelTransaction(txData.id, err => { if (err) { @@ -1408,6 +1410,7 @@ function cancelTx (txData) { */ function cancelTxs (txDataList) { return async (dispatch, getState) => { + window.onbeforeunload = null dispatch(actions.showLoadingIndication()) const txIds = txDataList.map(({id}) => id) const cancellations = txIds.map((id) => new Promise((resolve, reject) => { @@ -1810,6 +1813,7 @@ function addTokens (tokens) { function removeSuggestedTokens () { return (dispatch) => { dispatch(actions.showLoadingIndication()) + window.onbeforeunload = null return new Promise((resolve, reject) => { background.removeSuggestedTokens((err, suggestedTokens) => { dispatch(actions.hideLoadingIndication()) |