aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorFrankie <frankie.pangilinan@consensys.net>2016-09-16 01:26:02 +0800
committerFrankie <frankie.pangilinan@consensys.net>2016-09-16 01:26:02 +0800
commit8ea086290b6aa78c35a502dc6e81e4efab904430 (patch)
tree06258d6566cc6377a8c87d62108e2c208c7a15f6 /app
parentef0b535d94d97827b4bfc471e4d950d90d637fa3 (diff)
parent06b9adf172010600c7ac1127ff2ee76a7433e97b (diff)
downloadtangerine-wallet-browser-8ea086290b6aa78c35a502dc6e81e4efab904430.tar
tangerine-wallet-browser-8ea086290b6aa78c35a502dc6e81e4efab904430.tar.gz
tangerine-wallet-browser-8ea086290b6aa78c35a502dc6e81e4efab904430.tar.bz2
tangerine-wallet-browser-8ea086290b6aa78c35a502dc6e81e4efab904430.tar.lz
tangerine-wallet-browser-8ea086290b6aa78c35a502dc6e81e4efab904430.tar.xz
tangerine-wallet-browser-8ea086290b6aa78c35a502dc6e81e4efab904430.tar.zst
tangerine-wallet-browser-8ea086290b6aa78c35a502dc6e81e4efab904430.zip
Merge branch 'master' into i#519buyButtonTxConf
Diffstat (limited to 'app')
-rw-r--r--app/manifest.json2
-rw-r--r--app/scripts/background.js25
2 files changed, 10 insertions, 17 deletions
diff --git a/app/manifest.json b/app/manifest.json
index a21e0612a..daf9ef94a 100644
--- a/app/manifest.json
+++ b/app/manifest.json
@@ -1,7 +1,7 @@
{
"name": "MetaMask",
"short_name": "Metamask",
- "version": "2.11.1",
+ "version": "2.12.1",
"manifest_version": 2,
"author": "https://metamask.io",
"description": "Ethereum Browser Extension",
diff --git a/app/scripts/background.js b/app/scripts/background.js
index 58228a41a..652acc113 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -10,31 +10,22 @@ const MetamaskController = require('./metamask-controller')
const extension = require('./lib/extension')
const STORAGE_KEY = 'metamask-config'
-
+var popupIsOpen = false
const controller = new MetamaskController({
// User confirmation callbacks:
- showUnconfirmedMessage,
- unlockAccountMessage,
- showUnconfirmedTx,
+ showUnconfirmedMessage: triggerUi,
+ unlockAccountMessage: triggerUi,
+ showUnconfirmedTx: triggerUi,
// Persistence Methods:
setData,
loadData,
})
const idStore = controller.idStore
-function unlockAccountMessage () {
- notification.show()
-}
-
-function showUnconfirmedMessage (msgParams, msgId) {
- notification.show()
+function triggerUi () {
+ if (!popupIsOpen) notification.show()
}
-
-function showUnconfirmedTx (txParams, txData, onTxDoneCb) {
- notification.show()
-}
-
// On first install, open a window to MetaMask website to how-it-works.
extension.runtime.onInstalled.addListener(function (details) {
@@ -53,7 +44,8 @@ function connectRemote (remotePort) {
var portStream = new PortStream(remotePort)
if (isMetaMaskInternalProcess) {
// communication with popup
- setupTrustedCommunication(portStream, 'MetaMask')
+ popupIsOpen = remotePort.name === 'popup'
+ setupTrustedCommunication(portStream, 'MetaMask', remotePort.name)
} else {
// communication with page
var originDomain = urlUtil.parse(remotePort.sender.url).hostname
@@ -95,6 +87,7 @@ function setupControllerConnection (stream) {
// teardown on disconnect
eos(stream, () => {
controller.ethStore.removeListener('update', controller.sendUpdate.bind(controller))
+ popupIsOpen = false
})
})
}