Skip to content

Commit a211cd1

Browse files
committed
Set node_backend bindings in main process
1 parent 1e15fd8 commit a211cd1

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

app/background/node/service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class NodeService extends EventEmitter {
6565
hsdWindow.webContents.removeListener('error', lis);
6666

6767
if (channel === 'error') {
68-
console.error('Error opening hsd window:', args[0]);
68+
console.error('Error opening hsd window:', args);
6969
return reject(args[0]);
7070
}
7171

app/hsdMain.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ ipc.on('start', (_, prefix, net, apiKey) => {
4747
.then(() => hsd.connect())
4848
.then(() => hsd.startSync())
4949
.then(() => ipc.send('started'))
50-
.catch((e) => ipc.send('error', e));
50+
.catch((e) => {
51+
console.log(e);
52+
ipc.send('error', e)
53+
});
5154
});
5255

5356
ipc.on('close', () => {

app/main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require('./sentry');
22

3-
import { app, dialog } from 'electron';
3+
import {app, dialog} from 'electron';
44
import MenuBuilder from './menu';
55
import showMainWindow from './mainWindow';
66

@@ -19,6 +19,11 @@ if (
1919
}
2020

2121
app.on('ready', async () => {
22+
// Need this to force bcrypto to use
23+
// the JavaScript backend since native
24+
// bindings are unsupported in Electron.
25+
process.env.NODE_BACKEND = 'js';
26+
2227
// start the IPC server
2328
const dbService = require('./background/db/service');
2429
try {

0 commit comments

Comments
 (0)