diff options
Close notification on opening main UI
Diffstat (limited to 'app/scripts/lib/notifications.js')
-rw-r--r-- | app/scripts/lib/notifications.js | 11 |
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) + }) +} |