mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
cleanup
This commit is contained in:
@@ -6,7 +6,6 @@ const autoUpdater = electron.autoUpdater
|
||||
const path = require('path')
|
||||
const ChildProcess = require('child_process')
|
||||
const _ = require('lodash')
|
||||
const nodeIpc = require('@rokt33r/node-ipc')
|
||||
const GhReleases = require('electron-gh-releases')
|
||||
// electron.crashReporter.start()
|
||||
|
||||
@@ -154,37 +153,37 @@ updater.on('update-downloaded', (info) => {
|
||||
}
|
||||
})
|
||||
|
||||
nodeIpc.config.id = 'node'
|
||||
nodeIpc.config.retry = 1500
|
||||
nodeIpc.config.silent = true
|
||||
// nodeIpc.config.id = 'node'
|
||||
// nodeIpc.config.retry = 1500
|
||||
// nodeIpc.config.silent = true
|
||||
|
||||
nodeIpc.serve(
|
||||
path.join(app.getPath('userData'), 'boost.service'),
|
||||
function () {
|
||||
nodeIpc.server.on(
|
||||
'connect',
|
||||
function (socket) {
|
||||
socket.on('close', function () {
|
||||
console.log('socket dead')
|
||||
if (!appQuit) spawnFinder()
|
||||
})
|
||||
}
|
||||
)
|
||||
nodeIpc.server.on(
|
||||
'message',
|
||||
function (data, socket) {
|
||||
console.log('>>', data)
|
||||
handleIpcEvent(data)
|
||||
}
|
||||
)
|
||||
nodeIpc.server.on(
|
||||
'error',
|
||||
function (err) {
|
||||
console.log('>>', err)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
// nodeIpc.serve(
|
||||
// path.join(app.getPath('userData'), 'boost.service'),
|
||||
// function () {
|
||||
// nodeIpc.server.on(
|
||||
// 'connect',
|
||||
// function (socket) {
|
||||
// socket.on('close', function () {
|
||||
// console.log('socket dead')
|
||||
// if (!appQuit) spawnFinder()
|
||||
// })
|
||||
// }
|
||||
// )
|
||||
// nodeIpc.server.on(
|
||||
// 'message',
|
||||
// function (data, socket) {
|
||||
// console.log('>>', data)
|
||||
// handleIpcEvent(data)
|
||||
// }
|
||||
// )
|
||||
// nodeIpc.server.on(
|
||||
// 'error',
|
||||
// function (err) {
|
||||
// console.log('>>', err)
|
||||
// }
|
||||
// )
|
||||
// }
|
||||
// )
|
||||
|
||||
function handleIpcEvent (payload) {
|
||||
switch (payload.type) {
|
||||
@@ -303,12 +302,12 @@ app.on('ready', function () {
|
||||
// // Do nothing.
|
||||
// }
|
||||
|
||||
nodeIpc.server.start(function (err) {
|
||||
if (err.code === 'EADDRINUSE') {
|
||||
notify('Error occurs!', 'You have to kill other Boostnote processes.')
|
||||
quitApp()
|
||||
}
|
||||
})
|
||||
// nodeIpc.server.start(function (err) {
|
||||
// if (err.code === 'EADDRINUSE') {
|
||||
// notify('Error occurs!', 'You have to kill other Boostnote processes.')
|
||||
// quitApp()
|
||||
// }
|
||||
// })
|
||||
|
||||
require('./hotkey')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user