mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #655 from MetaMask/FixPortStreamEnd
Fix port stream end bug
This commit is contained in:
commit
11363b4f2a
@ -1,4 +1,6 @@
|
|||||||
const extension = require('./extension')
|
const extension = require('./extension')
|
||||||
|
const height = 500
|
||||||
|
const width = 360
|
||||||
|
|
||||||
const notifications = {
|
const notifications = {
|
||||||
show,
|
show,
|
||||||
@ -24,8 +26,8 @@ function show () {
|
|||||||
url: 'notification.html',
|
url: 'notification.html',
|
||||||
type: 'popup',
|
type: 'popup',
|
||||||
focused: true,
|
focused: true,
|
||||||
width: 360,
|
width,
|
||||||
height: 500,
|
height,
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -51,7 +53,11 @@ function getPopup(cb) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getPopupIn(windows) {
|
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() {
|
function closePopup() {
|
||||||
|
@ -30,8 +30,7 @@ PortDuplexStream.prototype._onMessage = function (msg) {
|
|||||||
|
|
||||||
PortDuplexStream.prototype._onDisconnect = function () {
|
PortDuplexStream.prototype._onDisconnect = function () {
|
||||||
try {
|
try {
|
||||||
// this.end()
|
this.push(null)
|
||||||
this.emit('close')
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.emit('error', err)
|
this.emit('error', err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user