on -> once

This commit is contained in:
Feross Aboukhadijeh
2016-06-01 00:10:26 -07:00
parent 8fc61a1c90
commit dac34541d6
4 changed files with 7 additions and 8 deletions

View File

@@ -55,7 +55,7 @@ function init () {
ipc.init()
app.on('will-finish-launching', function () {
app.once('will-finish-launching', function () {
crashReporter.init()
})
@@ -70,7 +70,7 @@ function init () {
setTimeout(delayedInit, config.DELAYED_INIT)
})
app.on('ipcReady', function () {
app.once('ipcReady', function () {
log('Command line args:', argv)
processArgv(argv)
console.timeEnd('init')
@@ -117,7 +117,6 @@ function onOpen (e, torrentId) {
function onAppOpen (newArgv) {
newArgv = sliceArgv(newArgv)
console.log(newArgv)
if (app.ipcReady) {
log('Second app instance opened, but was prevented:', newArgv)

View File

@@ -17,7 +17,7 @@ function log (...args) {
if (app.ipcReady) {
windows.main.send('log', ...args)
} else {
app.on('ipcReady', () => windows.main.send('log', ...args))
app.once('ipcReady', () => windows.main.send('log', ...args))
}
}
@@ -25,6 +25,6 @@ function error (...args) {
if (app.ipcReady) {
windows.main.send('error', ...args)
} else {
app.on('ipcReady', () => windows.main.send('error', ...args))
app.once('ipcReady', () => windows.main.send('error', ...args))
}
}