tui: Error handling tweak
Moved errors to bottom of screen, fix infinite loop by typing errors properly
This commit is contained in:
@@ -182,7 +182,7 @@ func (m *Model) loadConversations() tea.Cmd {
|
||||
return func() tea.Msg {
|
||||
err, conversations := m.App.LoadConversations()
|
||||
if err != nil {
|
||||
return shared.MsgError(fmt.Errorf("Could not load conversations: %v", err))
|
||||
return shared.AsMsgError(fmt.Errorf("Could not load conversations: %v", err))
|
||||
}
|
||||
return msgConversationsLoaded(conversations)
|
||||
}
|
||||
@@ -192,7 +192,7 @@ func (m *Model) deleteConversation(conv api.Conversation) tea.Cmd {
|
||||
return func() tea.Msg {
|
||||
err := m.App.Ctx.Store.DeleteConversation(&conv)
|
||||
if err != nil {
|
||||
return shared.MsgError(fmt.Errorf("Could not delete conversation: %v", err))
|
||||
return shared.AsMsgError(fmt.Errorf("Could not delete conversation: %v", err))
|
||||
}
|
||||
return msgConversationDeleted{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user