From e145437c62fe7f42e673b95002627a6dfee6255b Mon Sep 17 00:00:00 2001 From: Adrian Edwards <17362949+MoralCode@users.noreply.github.com> Date: Sun, 18 Oct 2020 16:09:15 -0700 Subject: [PATCH] populate the channel model with only channels from the selected guild (if there is one) --- discover_overlay/text_settings.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/discover_overlay/text_settings.py b/discover_overlay/text_settings.py index 890de52..36535d1 100644 --- a/discover_overlay/text_settings.py +++ b/discover_overlay/text_settings.py @@ -51,12 +51,19 @@ class TextSettingsWindow(SettingsWindow): for guild in self.guild_list(): guild_id, guild_name = guild self.channel_lookup.append('0') - c_model.append([guild_name, False]) self.guild_lookup.append(guild) g_model.append([guild_name, True]) + + if self.guild == "0": + c_model.append([guild_name, False]) + guilds_by_id = guild_id + else: + guilds_by_id = self.guild + + for c in self.list_channels_keys: chan = self.list_channels[c] - if chan['guild_id'] == guild_id: + if chan['guild_id'] == guilds_by_id: c_model.append([chan["name"], True]) self.channel_lookup.append(c)