@poolse/react-native 2.0.11 → 2.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1499,14 +1499,17 @@ var MessageComposer = react.forwardRef(
1499
1499
  const submitDisabled = disabled || sending || isUploading || value.trim().length === 0 && readyAttachmentIds.length === 0;
1500
1500
  const handleSend = async () => {
1501
1501
  if (submitDisabled) return;
1502
+ const body = value.trim();
1503
+ const replyId = replyingTo?.id;
1504
+ const attachmentIds = readyAttachmentIds;
1505
+ setValue("");
1506
+ upload.reset();
1502
1507
  setSending(true);
1503
1508
  try {
1504
- await onSend(value.trim(), {
1505
- ...replyingTo ? { quoted_message_id: replyingTo.id } : {},
1506
- ...readyAttachmentIds.length > 0 ? { attachment_ids: readyAttachmentIds } : {}
1509
+ await onSend(body, {
1510
+ ...replyId ? { quoted_message_id: replyId } : {},
1511
+ ...attachmentIds.length > 0 ? { attachment_ids: attachmentIds } : {}
1507
1512
  });
1508
- setValue("");
1509
- upload.reset();
1510
1513
  } finally {
1511
1514
  setSending(false);
1512
1515
  }