feat(ui): set main Flex as root after open link action

This commit is contained in:
ayntgl 2022-08-19 20:55:09 +05:30
parent 3f124bebec
commit 93bb0b6234
2 changed files with 5 additions and 1 deletions

View file

@ -164,11 +164,12 @@ func (app *App) onStateReady(r *gateway.ReadyEvent) {
}
func (app *App) onStateGuildCreate(g *gateway.GuildCreateEvent) {
rootNode := app.GuildsTree.GetRoot()
guildNode := tview.NewTreeNode(g.Name)
guildNode.SetReference(g.ID)
rootNode := app.GuildsTree.GetRoot()
rootNode.AddChild(guildNode)
app.Draw()
}

View file

@ -174,6 +174,9 @@ func NewMessageActionsList(app *App, m *discord.Message) *MessageActionsList {
for _, l := range links {
go open.Run(l)
}
app.SetRoot(app.MainFlex, true)
app.SetFocus(app.MessagesTextView)
})
}