aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/background.js
diff options
context:
space:
mode:
authorDan Finlay <somniac@me.com>2016-06-18 01:48:44 +0800
committerGitHub <noreply@github.com>2016-06-18 01:48:44 +0800
commit7ecc028c5db7d53d00a15c607e1bec711dae7213 (patch)
tree6dd880a733c5ca2ff1c7cba3f941fe6ec8fd8838 /app/scripts/background.js
parent281ed1c2bba4a149b36b4f614c5e4071ceb57e07 (diff)
parentc1e94442007803c8a27534f4e10af256285fcfe6 (diff)
downloadtangerine-wallet-browser-7ecc028c5db7d53d00a15c607e1bec711dae7213.tar
tangerine-wallet-browser-7ecc028c5db7d53d00a15c607e1bec711dae7213.tar.gz
tangerine-wallet-browser-7ecc028c5db7d53d00a15c607e1bec711dae7213.tar.bz2
tangerine-wallet-browser-7ecc028c5db7d53d00a15c607e1bec711dae7213.tar.lz
tangerine-wallet-browser-7ecc028c5db7d53d00a15c607e1bec711dae7213.tar.xz
tangerine-wallet-browser-7ecc028c5db7d53d00a15c607e1bec711dae7213.tar.zst
tangerine-wallet-browser-7ecc028c5db7d53d00a15c607e1bec711dae7213.zip
Merge pull request #296 from MetaMask/i252
idStore - add DELEGATE_CALL detection
Diffstat (limited to 'app/scripts/background.js')
-rw-r--r--app/scripts/background.js22
1 files changed, 12 insertions, 10 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index 1098efe87..3ad95d3e9 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -248,15 +248,15 @@ function updateBadge(state){
// Add unconfirmed Tx + Msg
//
-function newUnsignedTransaction(txParams, cb){
+function newUnsignedTransaction(txParams, onTxDoneCb){
var state = idStore.getState()
if (!state.isUnlocked) {
createUnlockRequestNotification({
title: 'Account Unlock Request',
})
- var txId = idStore.addUnconfirmedTransaction(txParams, cb)
+ idStore.addUnconfirmedTransaction(txParams, onTxDoneCb, noop)
} else {
- addUnconfirmedTx(txParams, cb)
+ addUnconfirmedTx(txParams, onTxDoneCb)
}
}
@@ -272,13 +272,15 @@ function newUnsignedMessage(msgParams, cb){
}
}
-function addUnconfirmedTx(txParams, cb){
- var txId = idStore.addUnconfirmedTransaction(txParams, cb)
- createTxNotification({
- title: 'New Unsigned Transaction',
- txParams: txParams,
- confirm: idStore.approveTransaction.bind(idStore, txId, noop),
- cancel: idStore.cancelTransaction.bind(idStore, txId),
+function addUnconfirmedTx(txParams, onTxDoneCb){
+ idStore.addUnconfirmedTransaction(txParams, onTxDoneCb, function(err, txData){
+ if (err) return onTxDoneCb(err)
+ createTxNotification({
+ title: 'New Unsigned Transaction',
+ txParams: txParams,
+ confirm: idStore.approveTransaction.bind(idStore, txData.id, noop),
+ cancel: idStore.cancelTransaction.bind(idStore, txData.id),
+ })
})
}