Reviews
ChangeAfter
- Lines from 118
- async function submit() {
- const value = text.trim();
- if (!value || sending) return;
- setSending(true);
- setError(null);
- Removed: setText("");
- Removed: onTyping?.(false);
- try {
- await onSend(value);
- Added: setText("");
- Added: onTyping?.(false);
- } catch (e) {
- Removed: setError("Couldn't send. Try again.");
- Added: // The draft stays in the box: a failed send must never cost the message.
- Added: setError(e instanceof Error ? e.message : "Couldn't send. Your message is still here.");
- } finally {
- setSending(false);
- }
- }