Skip to content

Commit 9492643

Browse files
authoredSep 2, 2022
fix: make sure to behave as node.js in electron main process (#761)
Fixes #760; electron main process can be treated as node.js, so we don't need to use remote server.
1 parent 30d3b25 commit 9492643

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/factory.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import mergeOptions from 'merge-options'
22
import { tmpDir } from './utils.js'
3-
import { isNode } from 'wherearewe'
3+
import { isNode, isElectronMain } from 'wherearewe'
44
import http from 'ipfs-utils/src/http.js'
55
import ControllerDaemon from './ipfsd-daemon.js'
66
import ControllerRemote from './ipfsd-client.js'
@@ -17,7 +17,7 @@ const merge = mergeOptions.bind({ ignoreUndefined: true })
1717
*/
1818

1919
const defaults = {
20-
remote: !isNode,
20+
remote: !isNode && !isElectronMain,
2121
endpoint: process.env.IPFSD_CTL_SERVER || 'http://localhost:43134',
2222
disposable: true,
2323
test: false,

0 commit comments

Comments
 (0)