aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-03-11 07:39:31 +0800
committerkumavis <aaron@kumavis.me>2016-03-11 07:39:31 +0800
commit4ac689c1e30d10d9999d27a7c502fff7c27a6263 (patch)
tree4b6ba7030dc297e8827f838af5bdeb0043b2b095 /app
parent1ffc98917d82620b33fc1d2005bf3d2d31db47cd (diff)
downloadtangerine-wallet-browser-4ac689c1e30d10d9999d27a7c502fff7c27a6263.tar
tangerine-wallet-browser-4ac689c1e30d10d9999d27a7c502fff7c27a6263.tar.gz
tangerine-wallet-browser-4ac689c1e30d10d9999d27a7c502fff7c27a6263.tar.bz2
tangerine-wallet-browser-4ac689c1e30d10d9999d27a7c502fff7c27a6263.tar.lz
tangerine-wallet-browser-4ac689c1e30d10d9999d27a7c502fff7c27a6263.tar.xz
tangerine-wallet-browser-4ac689c1e30d10d9999d27a7c502fff7c27a6263.tar.zst
tangerine-wallet-browser-4ac689c1e30d10d9999d27a7c502fff7c27a6263.zip
unsig tx - show notification on new tx
Diffstat (limited to 'app')
-rw-r--r--app/manifest.json1
-rw-r--r--app/scripts/background.js18
2 files changed, 17 insertions, 2 deletions
diff --git a/app/manifest.json b/app/manifest.json
index cc180945d..af64da008 100644
--- a/app/manifest.json
+++ b/app/manifest.json
@@ -36,6 +36,7 @@
}
],
"permissions": [
+ "notifications",
"storage",
"tabs",
"http://localhost:8545/"
diff --git a/app/scripts/background.js b/app/scripts/background.js
index aa74cb921..4567dc656 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -45,7 +45,7 @@ var zeroClient = MetaMaskProvider({
var result = selectedAddress ? [selectedAddress] : []
cb(null, result)
},
- approveTransaction: idStore.addUnconfirmedTransaction.bind(idStore),
+ approveTransaction: addUnconfirmedTx,
signTransaction: idStore.signTransaction.bind(idStore),
})
@@ -71,7 +71,7 @@ function onRpcRequest(remoteStream, payload){
// console.log('MetaMaskPlugin - incoming payload:', payload)
zeroClient.sendAsync(payload, function onPayloadHandled(err, response){
// provider engine errors are included in response objects
- // if (!payload.isMetamaskInternal) console.log('MetaMaskPlugin - RPC complete:', payload, '->', response)
+ if (!payload.isMetamaskInternal) console.log('MetaMaskPlugin - RPC complete:', payload, '->', response)
try {
remoteStream.write(response)
} catch (err) {
@@ -155,6 +155,20 @@ function updateBadge(state){
}
//
+// Add unconfirmed Tx
+//
+
+function addUnconfirmedTx(txParams, cb){
+ chrome.notifications.create({
+ type: 'basic',
+ iconUrl: '/images/icon-128.png',
+ title: 'New Transaction',
+ message: 'click the extension to confirm...',
+ })
+ idStore.addUnconfirmedTransaction(txParams, cb)
+}
+
+//
// config
//