This commit is contained in:
Feross Aboukhadijeh
2016-04-05 18:34:09 -07:00
parent cf3b319fc7
commit 2549307a7e

View File

@@ -79,16 +79,13 @@ function init () {
ipcMain.emit = function (name, e, ...args) {
// Relay messages between the main window and the WebTorrent hidden window
if (name.startsWith('wt-')) {
var recipient, recipientStr
if (e.sender.browserWindowOptions.title === 'webtorrent-hidden-window') {
recipient = windows.main
recipientStr = 'main'
windows.main.send(name, ...args)
log('webtorrent ipc: sent %s', name)
} else {
recipient = windows.webtorrent
recipientStr = 'webtorrent'
windows.webtorrent.send(name, ...args)
log('webtorrent ipc: receieved %s', name)
}
console.log('sending %s to %s', name, recipientStr)
recipient.send(name, ...args)
return
}