fix: draw msgs only when the channel is in cache
This commit is contained in:
parent
8f4667dc5f
commit
79923f98dc
1 changed files with 3 additions and 4 deletions
|
|
@ -190,18 +190,17 @@ func (gt *GuildsTree) onSelected(n *tview.TreeNode) {
|
|||
|
||||
gt.createChannelNodes(n, cs)
|
||||
case discord.ChannelID:
|
||||
app.messagesText.drawMsgs(ref)
|
||||
app.messagesText.ScrollToEnd()
|
||||
|
||||
c, err := discordState.Cabinet.Channel(ref)
|
||||
if err != nil {
|
||||
slog.Error("failed to get channel", "channel_id", ref)
|
||||
return
|
||||
}
|
||||
|
||||
app.messagesText.drawMsgs(c.ID)
|
||||
app.messagesText.ScrollToEnd()
|
||||
app.messagesText.SetTitle(gt.channelToString(*c))
|
||||
|
||||
gt.selectedChannelID = ref
|
||||
gt.selectedChannelID = c.ID
|
||||
gt.app.SetFocus(app.messageInput)
|
||||
case nil: // Direct messages
|
||||
cs, err := discordState.PrivateChannels()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue