aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/background.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-06-17 10:51:34 +0800
committerkumavis <aaron@kumavis.me>2016-06-17 10:51:34 +0800
commitc1e94442007803c8a27534f4e10af256285fcfe6 (patch)
tree1b47f8dee78d88362f861a3b596d290367374ce6 /app/scripts/background.js
parent08a153e20306da3aee585fc8b3bcfec2d73ce49e (diff)
downloadtangerine-wallet-browser-c1e94442007803c8a27534f4e10af256285fcfe6.tar
tangerine-wallet-browser-c1e94442007803c8a27534f4e10af256285fcfe6.tar.gz
tangerine-wallet-browser-c1e94442007803c8a27534f4e10af256285fcfe6.tar.bz2
tangerine-wallet-browser-c1e94442007803c8a27534f4e10af256285fcfe6.tar.lz
tangerine-wallet-browser-c1e94442007803c8a27534f4e10af256285fcfe6.tar.xz
tangerine-wallet-browser-c1e94442007803c8a27534f4e10af256285fcfe6.tar.zst
tangerine-wallet-browser-c1e94442007803c8a27534f4e10af256285fcfe6.zip
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 f64209ecc..ff991961d 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -247,15 +247,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)
}
}
@@ -271,13 +271,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),
+ })
})
}