Sort channels on guild and channel selected
This commit is contained in:
parent
74157d846d
commit
353a66b079
1 changed files with 5 additions and 1 deletions
|
|
@ -158,7 +158,7 @@ func onGuildsDropDownSelected(_ string, i int) {
|
|||
return
|
||||
}
|
||||
|
||||
sort.Slice(channels, func(i, j int) bool {
|
||||
sort.SliceStable(channels, func(i, j int) bool {
|
||||
return channels[i].Position < channels[j].Position
|
||||
})
|
||||
|
||||
|
|
@ -196,6 +196,10 @@ func onChannelsTreeViewSelected(node *tview.TreeNode) {
|
|||
return
|
||||
}
|
||||
|
||||
sort.SliceStable(channels, func(i, j int) bool {
|
||||
return channels[i].Position < channels[j].Position
|
||||
})
|
||||
|
||||
for i := range channels {
|
||||
channel := channels[i]
|
||||
if (channel.Type == discord.GuildText || channel.Type == discord.GuildNews) && channel.CategoryID == currentChannel.ID {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue