wip: fix redoing

This commit is contained in:
Dax Raad
2025-07-23 20:42:02 -04:00
parent 96866e52ce
commit 1ad529db59
2 changed files with 8 additions and 0 deletions

View File

@@ -925,6 +925,13 @@ func (m *messagesComponent) UndoLastMessage() (tea.Model, tea.Cmd) {
}
func (m *messagesComponent) RedoLastMessage() (tea.Model, tea.Cmd) {
// Check if there's a revert state to redo from
if m.app.Session.Revert.MessageID == "" {
return m, func() tea.Msg {
return toast.NewErrorToast("Nothing to redo")
}
}
before := float64(0)
var revertedMessage app.Message
for _, message := range m.app.Messages {