fix(chats): replying while editing a message drops the edit's text

reply() left edit mode but kept the edited message's prefilled text, so Send posted it
again as a new reply. It now cancels the edit, text included, in Marmot and in Concord
(which had the same bug). Checked on the tablet: Edit a message, Reply to another, the
composer is empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vitor Pamplona
2026-09-28 10:47:50 -04:00
co-authored by Claude Opus 5.5
parent 8d3565c124
commit 9528c81212
2 changed files with 6 additions and 2 deletions
@@ -93,7 +93,9 @@ open class MarmotNewMessageViewModel : ViewModel() {
fun reply(note: Note) {
replyTo.value = note
editingMessage.value = null
// Leaving edit mode drops the edited message's prefilled text too; kept, Send would
// post it again as a new reply.
if (editingMessage.value != null) cancelEdit()
}
/** Enter edit mode for my own [note], prefilled with the text it currently shows. */
@@ -133,7 +133,9 @@ open class ConcordNewMessageViewModel : ViewModel() {
fun reply(note: Note) {
replyTo.value = note
replyMode.value = ReplyMode.INLINE
editingMessage.value = null
// Leaving edit mode drops the edited message's prefilled text too; kept, Send would
// post it again as a new reply.
if (editingMessage.value != null) cancelEdit()
}
/** Enter edit mode for my own [note]: prefills the field with its current text; sending publishes a kind-1010 edit. */