Reviews
Work agents have handed to a person, and what became of it.
ChangeAfter
- ⋯ Lines from 118
- 118118 async function submit() {118 async function submit() {
- 119119 const value = text.trim();119 const value = text.trim();
- 120120 if (!value || sending) return;120 if (!value || sending) return;
- 121121 setSending(true);121 setSending(true);
- 122122 setError(null);122 setError(null);
- 123−Removed: setText("");
- 124−Removed: onTyping?.(false);
- 125123 try {123 try {
- 126124 await onSend(value);124 await onSend(value);
- 125+Added: setText("");125 setText("");
- 126+Added: onTyping?.(false);126 onTyping?.(false);
- 127127 } catch (e) {127 } catch (e) {
- 128−Removed: setError("Couldn't send. Try again.");
- 128+Added: // The draft stays in the box: a failed send must never cost the message.128 // The draft stays in the box: a failed send must never cost the message.
- 129+Added: setError(e instanceof Error ? e.message : "Couldn't send. Your message is still here.");129 setError(e instanceof Error ? e.message : "Couldn't send. Your message is still here.");
- 129130 } finally {130 } finally {
- 130131 setSending(false);131 setSending(false);
- 131132 }132 }
- 132133 }133 }