Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit d80f450

Browse files
committed
Fix object is not defined error again
1 parent 6b68013 commit d80f450

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/factory/ipfs-api.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ async function api_factory(ipfs_host, ipfs_port, orbitdb_dir, orbitdb_opts) {
1010
let dbm
1111
let orbitdb_api
1212

13+
if (!orbitdb_opts) orbitdb_opts = {}
14+
if (orbitdb_dir) orbitdb_opts = object.assign({'directory': orbitdb_dir}, orbitdb_opts)
1315
ipfs = new IpfsApi(ipfs_host, ipfs_port)
14-
if (orbitdb_dir) orbitdb_opts = object.assign({'directory': orbitdb_dir}, orbitdb_opts || {})
1516
orbitdb = await OrbitDB.createInstance(ipfs, orbitdb_opts)
1617
dbm = new DBManager(orbitdb)
1718
orbitdb_api = new OrbitApi(dbm)

src/factory/ipfs-local.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ async function api_factory(ipfs_opts, orbitdb_dir, orbitdb_opts) {
2121
}
2222
}
2323
}
24-
24+
if (!orbitdb_opts) orbitdb_opts = {}
25+
if (orbitdb_dir) orbitdb_opts = object.assign({'directory': orbitdb_dir}, orbitdb_opts)
2526
ipfs_opts = Object.assign(ipfs_defaults, ipfs_opts)
2627
ipfs = await new Promise((resolve, reject) => {
2728
var node = new Ipfs(ipfs_opts)
2829
node.on("ready", () => {
2930
resolve(node)
3031
})
3132
}).catch((ex) => {throw ex})
32-
if (orbitdb_dir) orbitdb_opts = object.assign({'directory': orbitdb_dir}, orbitdb_opts || {})
3333
orbitdb = await OrbitDB.createInstance(ipfs, orbitdb_opts)
3434
dbm = new DBManager(orbitdb)
3535
orbitdb_api = new OrbitApi(dbm)

0 commit comments

Comments
 (0)