@poolse/react-native 2.0.10 → 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
  }
@@ -1827,10 +1830,10 @@ function MessageList({
1827
1830
  renderItem: handleRender,
1828
1831
  onEndReached: hasMore ? onLoadMore : void 0,
1829
1832
  onEndReachedThreshold: 0.3,
1830
- ListHeaderComponent: ListFooter,
1833
+ ListHeaderComponent: ListHeader,
1831
1834
  ListFooterComponent: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { children: [
1832
1835
  hasMore && loading ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: theme.colors.ink3, style: { marginVertical: 8 } }) : null,
1833
- ListHeader
1836
+ ListFooter
1834
1837
  ] }),
1835
1838
  style: { backgroundColor: theme.colors.paper },
1836
1839
  contentContainerStyle: { paddingVertical: 8 }