aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/notifications.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2017-01-17 07:02:24 +0800
committerGitHub <noreply@github.com>2017-01-17 07:02:24 +0800
commitee62a6a3913967a6840d28ca812b94bbfa7a5779 (patch)
treecac32de6cc520917db9621ce93f7f4ad9abd787e /app/scripts/lib/notifications.js
parente8e06542e47b41668f196b6db54290490003845b (diff)
parent88fabdd2de78d0dd4be86b02c94a64d9748667fa (diff)
downloadtangerine-wallet-browser-ee62a6a3913967a6840d28ca812b94bbfa7a5779.tar.gz
tangerine-wallet-browser-ee62a6a3913967a6840d28ca812b94bbfa7a5779.tar.zst
tangerine-wallet-browser-ee62a6a3913967a6840d28ca812b94bbfa7a5779.zip
Merge pull request #1005 from MetaMask/dev
Merge dev into master!
Diffstat (limited to 'app/scripts/lib/notifications.js')
-rw-r--r--app/scripts/lib/notifications.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js
index cd7535232..3db1ac6b5 100644
--- a/app/scripts/lib/notifications.js
+++ b/app/scripts/lib/notifications.js
@@ -15,12 +15,9 @@ function show () {
if (err) throw err
if (popup) {
-
// bring focus to existing popup
extension.windows.update(popup.id, { focused: true })
-
} else {
-
// create new popup
extension.windows.create({
url: 'notification.html',
@@ -29,12 +26,11 @@ function show () {
width,
height,
})
-
}
})
}
-function getWindows(cb) {
+function getWindows (cb) {
// Ignore in test environment
if (!extension.windows) {
return cb()
@@ -45,14 +41,14 @@ function getWindows(cb) {
})
}
-function getPopup(cb) {
+function getPopup (cb) {
getWindows((err, windows) => {
if (err) throw err
cb(null, getPopupIn(windows))
})
}
-function getPopupIn(windows) {
+function getPopupIn (windows) {
return windows ? windows.find((win) => {
return (win && win.type === 'popup' &&
win.height === height &&
@@ -60,7 +56,7 @@ function getPopupIn(windows) {
}) : null
}
-function closePopup() {
+function closePopup () {
getPopup((err, popup) => {
if (err) throw err
if (!popup) return