OS X: open magnet links in WebTorrent

This commit is contained in:
Feross Aboukhadijeh
2016-03-19 17:09:05 -07:00
parent 6b6d1ee1c7
commit 0f263b89e5
3 changed files with 26 additions and 16 deletions

View File

@@ -40,13 +40,13 @@ ipc.init()
function onOpen (e, torrentId) {
e.preventDefault()
console.log(app.ipcReady)
if (app.ipcReady) {
openFiles()
onReadyOpen()
} else {
app.on('ipcReady', openFiles)
app.on('ipcReady', onReadyOpen)
}
function openFiles () {
windows.main.send('dispatch', 'openFiles', torrentId)
function onReadyOpen () {
windows.main.send('dispatch', 'onOpen', torrentId)
windows.main.focus()
}
}