From aff656a80922c0710a2df682a48f24cedaa4da16 Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Sun, 4 Mar 2018 18:44:12 -0800 Subject: [PATCH 1/2] Show a message box when lnd errors occur --- app/main.dev.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/main.dev.js b/app/main.dev.js index f90fbcc3..99efb7f6 100644 --- a/app/main.dev.js +++ b/app/main.dev.js @@ -10,7 +10,7 @@ * * */ -import { app, BrowserWindow, ipcMain } from 'electron' +import { app, BrowserWindow, ipcMain, dialog } from 'electron' import path from 'path' import fs from 'fs' import { spawn } from 'child_process' @@ -159,7 +159,13 @@ const startLnd = (alias, autopilot) => { ] const neutrino = spawn(lndConfig.lndPath, neutrinoArgs) - .on('error', error => console.log(`lnd error: ${error}`)) + .on('error', (error) => { + console.log(`lnd error: ${error}`) + dialog.showMessageBox({ + type: 'error', + message: `lnd error: ${error}` + }) + }) .on('close', code => console.log(`lnd shutting down ${code}`)) // Listen for when neutrino prints out data From 483064f95fc9f7aa81f70cc05ebcdc2251a9b249 Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Sun, 4 Mar 2018 18:46:10 -0800 Subject: [PATCH 2/2] Shut down app when lnd closes --- app/main.dev.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/main.dev.js b/app/main.dev.js index 99efb7f6..3fcc8654 100644 --- a/app/main.dev.js +++ b/app/main.dev.js @@ -166,7 +166,10 @@ const startLnd = (alias, autopilot) => { message: `lnd error: ${error}` }) }) - .on('close', code => console.log(`lnd shutting down ${code}`)) + .on('close', (code) => { + console.log(`lnd shutting down ${code}`) + app.quit() + }) // Listen for when neutrino prints out data neutrino.stdout.on('data', (data) => {