aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-26 09:49:37 -0700
committerAdam Soltys <[email protected]>2026-10-26 09:49:37 -0700
commit5fe2341616b2d1abdd7a3560371aff2d648e2311 (patch)
treec4900c4c460e0df6a87dbf16aa50f06fb36d9aa3 /src
parentef1739e2de914f0a02990979f13057cef77c9a44 (diff)
downloadcoinosv3-5fe2341616b2d1abdd7a3560371aff2d648e2311.tar.gz
coinosv3-5fe2341616b2d1abdd7a3560371aff2d648e2311.zip
Cancel on a reply discards what was typed and folds the box: it only cleared the "replying" flag, and the box stays up while a draft has text, so with anything typed it did nothing. Attachments the draft carried are dropped with it
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/features/messages.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/features/messages.js b/src/features/messages.js
index 6c51d93..d03c657 100644
--- a/src/features/messages.js
+++ b/src/features/messages.js
@@ -12576,7 +12576,19 @@ export function messagesFeature(ctx) {
previewBtn(!!s.preview, () => { s.preview = !s.preview; render(); }),
h('button', {
class: 'btn-ghost btn-sm thread-reply-cancel', type: 'button',
- onClick: () => { s.replying = false; s.preview = false; s.mediaMoment = null; render(); },
+ // Cancel discards: the typed text, its attachments and the box.
+ // (It only folded the `replying` flag before, and the box stays
+ // up while a draft has text — so with anything typed it did
+ // nothing visible.) The field may still be focused, and the
+ // morph leaves a focused field's value alone: clear it by hand.
+ onClick: () => {
+ const text = s.draft || '';
+ s.draft = ''; s.replying = false; s.preview = false; s.mediaMoment = null;
+ ui.postMedia = (ui.postMedia || []).filter((m) => !text.includes(m.url));
+ const inp = document.querySelector('.thread-reply-input');
+ if (inp) inp.value = '';
+ render();
+ },
}, t('cancel'))),
h('button', {
class: 'btn-primary btn-sm thread-reply-send', disabled: !!s.sending || !!ui.postUploading,