aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/notifications.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-11-22 03:03:32 +0800
committerDan Finlay <dan@danfinlay.com>2016-11-22 03:03:32 +0800
commit7ab9d408201ae65ad30512f1361df61a487a9330 (patch)
treecc7b208d36e9cf6eafcab5bd36edba0f46595a64 /app/scripts/lib/notifications.js
parente8a83026248e6e27e6d801cf1713551eb740137a (diff)
parent7021c7708c927b8723b6ba5842b451b6f46dbb3e (diff)
downloadtangerine-wallet-browser-7ab9d408201ae65ad30512f1361df61a487a9330.tar
tangerine-wallet-browser-7ab9d408201ae65ad30512f1361df61a487a9330.tar.gz
tangerine-wallet-browser-7ab9d408201ae65ad30512f1361df61a487a9330.tar.bz2
tangerine-wallet-browser-7ab9d408201ae65ad30512f1361df61a487a9330.tar.lz
tangerine-wallet-browser-7ab9d408201ae65ad30512f1361df61a487a9330.tar.xz
tangerine-wallet-browser-7ab9d408201ae65ad30512f1361df61a487a9330.tar.zst
tangerine-wallet-browser-7ab9d408201ae65ad30512f1361df61a487a9330.zip
Merge branch 'dev' into i831-AddRopsten-Dev
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