@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.js CHANGED
@@ -1476,14 +1476,17 @@ var MessageComposer = forwardRef(
1476
1476
  const submitDisabled = disabled || sending || isUploading || value.trim().length === 0 && readyAttachmentIds.length === 0;
1477
1477
  const handleSend = async () => {
1478
1478
  if (submitDisabled) return;
1479
+ const body = value.trim();
1480
+ const replyId = replyingTo?.id;
1481
+ const attachmentIds = readyAttachmentIds;
1482
+ setValue("");
1483
+ upload.reset();
1479
1484
  setSending(true);
1480
1485
  try {
1481
- await onSend(value.trim(), {
1482
- ...replyingTo ? { quoted_message_id: replyingTo.id } : {},
1483
- ...readyAttachmentIds.length > 0 ? { attachment_ids: readyAttachmentIds } : {}
1486
+ await onSend(body, {
1487
+ ...replyId ? { quoted_message_id: replyId } : {},
1488
+ ...attachmentIds.length > 0 ? { attachment_ids: attachmentIds } : {}
1484
1489
  });
1485
- setValue("");
1486
- upload.reset();
1487
1490
  } finally {
1488
1491
  setSending(false);
1489
1492
  }