feat(daemon): don't block app renderer on daemon start

This commit is contained in:
georgelima 2019-02-04 22:30:11 -02:00
parent 070c7c6047
commit 670145753a
1 changed files with 9 additions and 9 deletions

View File

@ -71,7 +71,7 @@ const createWindow = () => {
registerDebugShortcut(app, mainWindow);
mainWindow.loadURL(
isDev ? 'http://0.0.0.0:8080/' : `file://${path.join(__dirname, '../build/index.html')}`,
isDev ? 'http://localhost:8080/' : `file://${path.join(__dirname, '../build/index.html')}`,
);
exports.app = app;
@ -87,14 +87,14 @@ app.on('ready', async () => {
return;
}
const [err, proc] = await eres(runDaemon());
if (err || !proc) return zcashLog(err);
/* eslint-disable-next-line */
zcashLog(`Zcash Daemon running. PID: ${proc.pid}`);
zcashDaemon = proc;
runDaemon()
.then((proc) => {
if (proc) {
zcashLog(`Zcash Daemon running. PID: ${proc.pid}`);
zcashDaemon = proc;
}
})
.catch(zcashLog);
});
app.on('activate', () => {
if (mainWindow === null) createWindow();