Fix 'cannot set autostart of undefined'

Problem: `customConfig.conn` isn't defined.

Solution: Use `lodash.set()`.
This commit is contained in:
Christian Bundy 2020-05-04 13:44:00 -07:00
parent f86b73b40e
commit 8e30c93de8
1 changed files with 1 additions and 2 deletions

View File

@ -11,7 +11,6 @@ const flotilla = require("@fraction/flotilla");
const ssbTangle = require("ssb-tangle");
const debug = require("debug")("oasis");
const path = require("path");
const pull = require("pull-stream");
const lodash = require("lodash");
const socketPath = path.join(ssbConfig.path, "socket");
@ -144,7 +143,7 @@ module.exports = ({ offline }) => {
// Only change the config if `--offline` is true.
if (offline === true) {
customConfig.conn.autostart = false;
lodash.set(customConfig, "conn.autostart", false);
}
// Use `conn.hops`, or default to `friends.hops`, or default to `0`.