|
@@ -142,17 +142,12 @@ func (gt *guildsTree) createChannelNode(node *tview.TreeNode, channel discord.Ch
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (gt *guildsTree) createChannelNodes(node *tview.TreeNode, channels []discord.Channel) {
|
|
func (gt *guildsTree) createChannelNodes(node *tview.TreeNode, channels []discord.Channel) {
|
|
|
- var orphanChs []discord.Channel
|
|
|
|
|
- for _, ch := range channels {
|
|
|
|
|
- if ch.Type != discord.GuildCategory && !ch.ParentID.IsValid() {
|
|
|
|
|
- orphanChs = append(orphanChs, ch)
|
|
|
|
|
|
|
+ for _, channel := range channels {
|
|
|
|
|
+ if channel.Type != discord.GuildCategory && !channel.ParentID.IsValid() {
|
|
|
|
|
+ gt.createChannelNode(node, channel)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- for _, c := range orphanChs {
|
|
|
|
|
- gt.createChannelNode(node, c)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
PARENT_CHANNELS:
|
|
PARENT_CHANNELS:
|
|
|
for _, c := range channels {
|
|
for _, c := range channels {
|
|
|
if c.Type == discord.GuildCategory {
|
|
if c.Type == discord.GuildCategory {
|