aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/background.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-03-12 09:13:48 +0800
committerkumavis <aaron@kumavis.me>2016-03-12 09:13:48 +0800
commitb8e36f41a26f5dfa51b0e10df102bee10b377f6a (patch)
tree0c4fa31343534057edf6d2a0d8c96bbbfbcdb0eb /app/scripts/background.js
parentb3d46e02b8ede633149c6c9277ea33e75a75db65 (diff)
downloadtangerine-wallet-browser-b8e36f41a26f5dfa51b0e10df102bee10b377f6a.tar
tangerine-wallet-browser-b8e36f41a26f5dfa51b0e10df102bee10b377f6a.tar.gz
tangerine-wallet-browser-b8e36f41a26f5dfa51b0e10df102bee10b377f6a.tar.bz2
tangerine-wallet-browser-b8e36f41a26f5dfa51b0e10df102bee10b377f6a.tar.lz
tangerine-wallet-browser-b8e36f41a26f5dfa51b0e10df102bee10b377f6a.tar.xz
tangerine-wallet-browser-b8e36f41a26f5dfa51b0e10df102bee10b377f6a.tar.zst
tangerine-wallet-browser-b8e36f41a26f5dfa51b0e10df102bee10b377f6a.zip
notifications - add tx confirm+cancel buttons
Diffstat (limited to 'app/scripts/background.js')
-rw-r--r--app/scripts/background.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index 4567dc656..a724a87e8 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -8,6 +8,7 @@ const EthStore = require('eth-store')
const PortStream = require('./lib/port-stream.js')
const MetaMaskProvider = require('web3-provider-engine/zero.js')
const IdentityStore = require('./lib/idStore')
+const createTxNotification = require('./lib/tx-notification.js')
console.log('ready to roll')
@@ -159,13 +160,13 @@ function updateBadge(state){
//
function addUnconfirmedTx(txParams, cb){
- chrome.notifications.create({
- type: 'basic',
- iconUrl: '/images/icon-128.png',
- title: 'New Transaction',
- message: 'click the extension to confirm...',
+ 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),
})
- idStore.addUnconfirmedTransaction(txParams, cb)
}
//
@@ -204,4 +205,6 @@ function jsonStringifyStream(){
this.push(JSON.stringify(obj))
cb()
})
-} \ No newline at end of file
+}
+
+function noop(){} \ No newline at end of file