diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-11-18 06:27:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-18 06:27:34 +0800 |
commit | 6400eb8453c173e04e59d7990bd2c79afb3493be (patch) | |
tree | ecb311d43d0f77d5f5f0e82a0014a09c6381f0ef /app/scripts/lib/notifications.js | |
parent | 115fdc36fefd33e4bf4a9e551dd6267d3d75f2c5 (diff) | |
parent | 4352c7031afb6f9a175b29d0addeb7ea48345676 (diff) | |
download | tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.gz tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.bz2 tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.lz tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.xz tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.zst tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.zip |
Merge pull request #816 from MetaMask/i328-MultiVault
Multi vault to Dev Branch
Diffstat (limited to 'app/scripts/lib/notifications.js')
-rw-r--r-- | app/scripts/lib/notifications.js | 12 |
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 |