@poolse/react-ui 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
@@ -740,15 +740,15 @@ var MessageComposer = react.forwardRef(
740
740
  const ready = queue.filter((it) => it.status === "ready");
741
741
  const hasReady = ready.length > 0;
742
742
  if (!trimmed && !hasReady || sending || uploading) return;
743
+ const opts = {
744
+ ...replyingTo ? { quoted_message_id: replyingTo.id } : {},
745
+ ...hasReady ? { attachment_ids: ready.map((it) => it.attachment.id) } : {}
746
+ };
747
+ setValue("");
748
+ for (const it of ready) removeUpload(it.localId);
743
749
  setSending(true);
744
750
  try {
745
- const opts = {
746
- ...replyingTo ? { quoted_message_id: replyingTo.id } : {},
747
- ...hasReady ? { attachment_ids: ready.map((it) => it.attachment.id) } : {}
748
- };
749
751
  await onSend(trimmed, Object.keys(opts).length > 0 ? opts : void 0);
750
- setValue("");
751
- for (const it of ready) removeUpload(it.localId);
752
752
  } finally {
753
753
  setSending(false);
754
754
  }