This commit is contained in:
Oleksii Holub 2018-12-19 17:15:54 +02:00
parent bf5cedb646
commit e22e1c03fb
5 changed files with 27 additions and 12 deletions

View file

@ -137,9 +137,13 @@ namespace DiscordChatExporter.Gui.ViewModels
// Get DM channels
{
var channels = await _dataService.GetDirectMessageChannelsAsync(token);
var guild = Guild.DirectMessages;
_guildChannelsMap[guild] = channels.OrderBy(c => c.Name).ToArray();
var channels = await _dataService.GetDirectMessageChannelsAsync(token);
// Order channels
channels = channels.OrderBy(c => c.Name).ToArray();
_guildChannelsMap[guild] = channels;
}
// Get guild channels
@ -148,9 +152,11 @@ namespace DiscordChatExporter.Gui.ViewModels
foreach (var guild in guilds)
{
var channels = await _dataService.GetGuildChannelsAsync(token, guild.Id);
_guildChannelsMap[guild] = channels.Where(c => c.Type == ChannelType.GuildTextChat)
.OrderBy(c => c.Name)
.ToArray();
// Filter and order channels
channels = channels.Where(c => c.Type == ChannelType.GuildTextChat).OrderBy(c => c.Name).ToArray();
_guildChannelsMap[guild] = channels;
}
}