Private
Public Access
1
0

tui: fixed Init handling

Don't re-init components on each state change
This commit is contained in:
2024-04-01 17:03:49 +00:00
parent 39cd4227c6
commit 9e6d41a3ff
2 changed files with 7 additions and 5 deletions

View File

@@ -77,9 +77,13 @@ func initialModel(ctx *lmcli.Context, opts Options) model {
}
func (m model) Init() tea.Cmd {
return func() tea.Msg {
return msgChangeState(m.state)
}
return tea.Batch(
m.conversations.Init(),
m.chat.Init(),
func() tea.Msg {
return msgChangeState(m.state)
},
)
}
func (m *model) handleGlobalInput(msg tea.KeyMsg) (bool, tea.Cmd) {