Fix Exception when dropping .torrent file onto Dock icon when app is closed

Fixes #154
This commit is contained in:
Feross Aboukhadijeh
2016-03-19 15:59:22 -07:00
parent e9db07e855
commit 4f40e5d963
7 changed files with 35 additions and 18 deletions

View File

@@ -4,6 +4,7 @@ module.exports = {
var debug = require('debug')('webtorrent-app:ipcMain')
var electron = require('electron')
var app = electron.app
var ipcMain = electron.ipcMain
var powerSaveBlocker = electron.powerSaveBlocker
@@ -15,6 +16,12 @@ var windows = require('./windows')
var powerSaveBlockID = 0
function init () {
ipcMain.on('ipcReady', function (e) {
console.timeEnd('init')
app.ipcReady = true
app.emit('ipcReady')
})
ipcMain.on('showOpenTorrentFile', function (e) {
menu.showOpenTorrentFile()
})