@poolse/react-ui 0.2.0-alpha.6 → 0.2.0-alpha.7

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
@@ -449,10 +449,7 @@ function MessageComposer({
449
449
  if (!trimmed || sending) return;
450
450
  setSending(true);
451
451
  try {
452
- await onSend(
453
- trimmed,
454
- replyingTo ? { quoted_message_id: replyingTo.id } : void 0
455
- );
452
+ await onSend(trimmed, replyingTo ? { quoted_message_id: replyingTo.id } : void 0);
456
453
  setValue("");
457
454
  } finally {
458
455
  setSending(false);
@@ -1329,12 +1326,26 @@ function ConversationView({
1329
1326
  if (renderMessage) {
1330
1327
  return /* @__PURE__ */ jsx(Fragment$1, { children: renderMessage(msg, me?.id ?? null) }, msg.id);
1331
1328
  }
1329
+ const enriched = quotations && msg.quoted_message_id && !msg.quoted_message ? (() => {
1330
+ const original = messages.find((m) => m.id === msg.quoted_message_id);
1331
+ if (!original) return msg;
1332
+ return {
1333
+ ...msg,
1334
+ quoted_message: {
1335
+ id: original.id,
1336
+ sender_id: original.sender_id,
1337
+ body: original.body,
1338
+ deleted_at: original.deleted_at,
1339
+ inserted_at: original.inserted_at
1340
+ }
1341
+ };
1342
+ })() : msg;
1332
1343
  const isSelf = me !== null && msg.sender_id === me.id;
1333
1344
  const readState = readReceipts && isSelf && maxReadByOthers !== null ? maxReadByOthers >= msg.sequence ? "read" : "sent" : void 0;
1334
1345
  return /* @__PURE__ */ jsx("div", { "data-message-id": msg.id, children: /* @__PURE__ */ jsx(
1335
1346
  MessageRow,
1336
1347
  {
1337
- msg,
1348
+ msg: enriched,
1338
1349
  meId: me?.id ?? null,
1339
1350
  reactions,
1340
1351
  attachments,