style
This commit is contained in:
11
main/ipc.js
11
main/ipc.js
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user