aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/lib')
-rw-r--r--app/scripts/lib/notifications.js12
-rw-r--r--app/scripts/lib/port-stream.js3
2 files changed, 10 insertions, 5 deletions
diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js
index 4e3f7558c..422f46f6d 100644
--- a/app/scripts/lib/notifications.js
+++ b/app/scripts/lib/notifications.js
@@ -1,4 +1,6 @@
const extension = require('./extension')
+const height = 500
+const width = 360
const notifications = {
show,
@@ -24,8 +26,8 @@ function show () {
url: 'notification.html',
type: 'popup',
focused: true,
- width: 360,
- height: 500,
+ width,
+ height,
})
}
@@ -51,7 +53,11 @@ function getPopup(cb) {
}
function getPopupIn(windows) {
- return windows ? windows.find((win) => win.type === 'popup') : null
+ return windows ? windows.find((win) => {
+ return (win && win.type === 'popup' &&
+ win.height === height &&
+ win.width === width)
+ }) : null
}
function closePopup() {
diff --git a/app/scripts/lib/port-stream.js b/app/scripts/lib/port-stream.js
index 1889e3c04..6f59d4485 100644
--- a/app/scripts/lib/port-stream.js
+++ b/app/scripts/lib/port-stream.js
@@ -30,8 +30,7 @@ PortDuplexStream.prototype._onMessage = function (msg) {
PortDuplexStream.prototype._onDisconnect = function () {
try {
- // this.end()
- this.emit('close')
+ this.push(null)
} catch (err) {
this.emit('error', err)
}