tui: fixed Init handling
Don't re-init components on each state change
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user