aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/notifications.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-08-24 06:44:50 +0800
committerDan Finlay <dan@danfinlay.com>2016-08-24 06:44:50 +0800
commit671ca33abb93fafeb55a18543e81942c5963da8e (patch)
tree7a9ae4ac72b29e6365e10505a5c5307ad6638c9a /app/scripts/lib/notifications.js
parentb3887ffd0a33096ef63fd4bbba9b5ff559775b3e (diff)
downloadtangerine-wallet-browser-671ca33abb93fafeb55a18543e81942c5963da8e.tar
tangerine-wallet-browser-671ca33abb93fafeb55a18543e81942c5963da8e.tar.gz
tangerine-wallet-browser-671ca33abb93fafeb55a18543e81942c5963da8e.tar.bz2
tangerine-wallet-browser-671ca33abb93fafeb55a18543e81942c5963da8e.tar.lz
tangerine-wallet-browser-671ca33abb93fafeb55a18543e81942c5963da8e.tar.xz
tangerine-wallet-browser-671ca33abb93fafeb55a18543e81942c5963da8e.tar.zst
tangerine-wallet-browser-671ca33abb93fafeb55a18543e81942c5963da8e.zip
Close notification on opening main UI
Diffstat (limited to 'app/scripts/lib/notifications.js')
-rw-r--r--app/scripts/lib/notifications.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js
index c8ecad805..dcb946845 100644
--- a/app/scripts/lib/notifications.js
+++ b/app/scripts/lib/notifications.js
@@ -1,13 +1,14 @@
const extension = require('./extension')
const notifications = {
- show: showNotification,
+ show,
getPopup,
+ closePopup,
}
module.exports = notifications
window.METAMASK_NOTIFIER = notifications
-function showNotification() {
+function show () {
getPopup((popup) => {
if (popup) {
return extension.windows.update(popup.id, { focused: true })
@@ -39,3 +40,9 @@ function getPopup(cb) {
})
}
+function closePopup() {
+ getPopup((popup) => {
+ if (!popup) return
+ extension.windows.remove(popup.id, console.error)
+ })
+}