From 685ccdd226258fba3fbeb3f07dc27a5c864dd190 Mon Sep 17 00:00:00 2001 From: Miikka Date: Thu, 3 May 2018 19:37:50 +0300 Subject: [PATCH] Always show multi-server header when using multiple servers Previously, if the user was on only one server, the server name would not be shown in the thread header. --- src/data/threads.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/data/threads.js b/src/data/threads.js index 0b8883b..2701529 100644 --- a/src/data/threads.js +++ b/src/data/threads.js @@ -115,8 +115,9 @@ async function createNewThreadForUser(user, quiet = false) { // Guild info const guildInfoHeaderItems = new Map(); - - utils.getMainGuilds().forEach(guild => { + const mainGuilds = utils.getMainGuilds(); + + mainGuilds.forEach(guild => { const member = guild.members.get(user.id); if (! member) return; @@ -128,7 +129,7 @@ async function createNewThreadForUser(user, quiet = false) { }); guildInfoHeaderItems.forEach((items, guildName) => { - if (guildInfoHeaderItems.size === 1) { + if (mainGuilds.length === 1) { infoHeader += `\n${items.join(', ')}`; } else { infoHeader += `\n**[${guildName}]** ${items.join(', ')}`;