fix: tui not showing err toasts (#2290)

This commit is contained in:
Aiden Cline 2025-08-28 10:55:47 -05:00 committed by GitHub
parent aa9ab0a304
commit 37cf262094
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 8 deletions

View file

@ -826,7 +826,7 @@ func (a *App) SendCommand(ctx context.Context, command string, args string) (*Ap
)
if err != nil {
slog.Error("Failed to execute command", "error", err)
return toast.NewErrorToast("Failed to execute command")
return toast.NewErrorToast("Failed to execute command")()
}
return nil
})

View file

@ -1173,10 +1173,10 @@ func (m *messagesComponent) UndoLastMessage() (tea.Model, tea.Cmd) {
)
if err != nil {
slog.Error("Failed to undo message", "error", err)
return toast.NewErrorToast("Failed to undo message")
return toast.NewErrorToast("Failed to undo message")()
}
if response == nil {
return toast.NewErrorToast("Failed to undo message")
return toast.NewErrorToast("Failed to undo message")()
}
return app.MessageRevertedMsg{Session: *response, Message: revertedMessage}
}
@ -1241,10 +1241,10 @@ func (m *messagesComponent) RedoLastMessage() (tea.Model, tea.Cmd) {
)
if err != nil {
slog.Error("Failed to unrevert session", "error", err)
return toast.NewErrorToast("Failed to redo message")
return toast.NewErrorToast("Failed to redo message")()
}
if response == nil {
return toast.NewErrorToast("Failed to redo message")
return toast.NewErrorToast("Failed to redo message")()
}
return app.SessionUnrevertedMsg{Session: *response}
}
@ -1261,10 +1261,10 @@ func (m *messagesComponent) RedoLastMessage() (tea.Model, tea.Cmd) {
)
if err != nil {
slog.Error("Failed to redo message", "error", err)
return toast.NewErrorToast("Failed to redo message")
return toast.NewErrorToast("Failed to redo message")()
}
if response == nil {
return toast.NewErrorToast("Failed to redo message")
return toast.NewErrorToast("Failed to redo message")()
}
return app.MessageRevertedMsg{Session: *response, Message: revertedMessage}
}

View file

@ -134,7 +134,7 @@ func (a Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
)
if err != nil {
slog.Error("Failed to respond to permission request", "error", err)
return toast.NewErrorToast("Failed to respond to permission request")
return toast.NewErrorToast("Failed to respond to permission request")()
}
slog.Debug("Responded to permission request", "response", resp)
return nil