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) { ipcMain.emit = function (name, e, ...args) {
// Relay messages between the main window and the WebTorrent hidden window // Relay messages between the main window and the WebTorrent hidden window
if (name.startsWith('wt-')) { if (name.startsWith('wt-')) {
var recipient, recipientStr
if (e.sender.browserWindowOptions.title === 'webtorrent-hidden-window') { if (e.sender.browserWindowOptions.title === 'webtorrent-hidden-window') {
recipient = windows.main windows.main.send(name, ...args)
recipientStr = 'main' log('webtorrent ipc: sent %s', name)
} else { } else {
recipient = windows.webtorrent windows.webtorrent.send(name, ...args)
recipientStr = 'webtorrent' log('webtorrent ipc: receieved %s', name)
} }
console.log('sending %s to %s', name, recipientStr)
recipient.send(name, ...args)
return return
} }