Skip to content

Commit

Permalink
Set node_backend bindings in main process
Browse files Browse the repository at this point in the history
  • Loading branch information
mslipper committed Feb 12, 2020
1 parent 1e15fd8 commit a211cd1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/background/node/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class NodeService extends EventEmitter {
hsdWindow.webContents.removeListener('error', lis);

if (channel === 'error') {
console.error('Error opening hsd window:', args[0]);
console.error('Error opening hsd window:', args);
return reject(args[0]);
}

Expand Down
5 changes: 4 additions & 1 deletion app/hsdMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ ipc.on('start', (_, prefix, net, apiKey) => {
.then(() => hsd.connect())
.then(() => hsd.startSync())
.then(() => ipc.send('started'))
.catch((e) => ipc.send('error', e));
.catch((e) => {
console.log(e);
ipc.send('error', e)
});
});

ipc.on('close', () => {
Expand Down
7 changes: 6 additions & 1 deletion app/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require('./sentry');

import { app, dialog } from 'electron';
import {app, dialog} from 'electron';
import MenuBuilder from './menu';
import showMainWindow from './mainWindow';

Expand All @@ -19,6 +19,11 @@ if (
}

app.on('ready', async () => {
// Need this to force bcrypto to use
// the JavaScript backend since native
// bindings are unsupported in Electron.
process.env.NODE_BACKEND = 'js';

// start the IPC server
const dbService = require('./background/db/service');
try {
Expand Down

0 comments on commit a211cd1

Please sign in to comment.