feat(ui): set main Flex as root after open link action
This commit is contained in:
parent
3f124bebec
commit
93bb0b6234
2 changed files with 5 additions and 1 deletions
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue