Skip to content

Commit

Permalink
Updated daemon process handling
Browse files Browse the repository at this point in the history
  • Loading branch information
tgbv committed Jun 5, 2021
1 parent e4b69a3 commit 542dc78
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/html/comps/pass-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const PassInputComp = Vue.component('pass-input', {
if (this.password.length > 0) {
showDimmer()

res = await api.send('startDaemon', this.password, 5000)
res = await api.send('startDaemon', this.password, 10000)
if (res !== true) {
hideDimmer()
toast ('Could not start! '+res)
Expand Down
4 changes: 4 additions & 0 deletions src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,10 @@
toast ("Incorrect password!")
this.$refs.PassInput.fire()
})

api.receive('daemon_ERROR', str=>{
alert("Daemon error occurred: "+str)
})
})
}
})
Expand Down
6 changes: 5 additions & 1 deletion src/ipc-events/start-daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ module.exports = (ipcMain, mainWindow)=>{
let prevLog = ""

if(Daemon.get() === null)
Daemon.set(spawn(`${path.join(__dirname, `..`, `bin`, 'tofa-daemon.bin')}`))
Daemon.set(spawn(`${path.join(__dirname, `..`, `bin`, 'tofa-daemon.bin')}`, [
`-tor-bin=${path.join(__dirname, `..`, `bin`, 'tor.bin')}`
] ))
else {
mainWindow.webContents.send("startDaemon_RES", true)
return
Expand Down Expand Up @@ -74,6 +76,8 @@ module.exports = (ipcMain, mainWindow)=>{

if( str.includes("Apps broadcasted")) mainWindow.webContents.send("daemon_appsBroadcasted", true)

if( str.includes('panic:')) mainWindow.webContents.send("daemon_ERROR", str)

prevLog = data.toString()

// avoids 'object has been destroyed error'
Expand Down

0 comments on commit 542dc78

Please sign in to comment.