From fe031c8b1208b605bd6a6058f32017ad824ee50a Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Mon, 23 Dec 2019 10:27:12 +0200 Subject: [PATCH] Connect networks after setting user defaults --- src/client.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client.js b/src/client.js index b8f3e4ba..72a4378d 100644 --- a/src/client.js +++ b/src/client.js @@ -79,12 +79,6 @@ function Client(manager, name, config = {}) { } } - (client.config.networks || []).forEach((network) => client.connect(network, true)); - - // Networks are stored directly in the client object - // We don't need to keep it in the config object - delete client.config.networks; - if (typeof client.config.sessions !== "object") { client.config.sessions = {}; } @@ -115,6 +109,12 @@ function Client(manager, name, config = {}) { } }); + (client.config.networks || []).forEach((network) => client.connect(network, true)); + + // Networks are stored directly in the client object + // We don't need to keep it in the config object + delete client.config.networks; + if (client.name) { log.info(`User ${colors.bold(client.name)} loaded`);