fix: chat accepts posts

This commit is contained in:
gosangam
2026-08-29 16:26:53 +05:30
parent 76cd106ef7
commit 3e6a1c6f39
5 changed files with 118 additions and 21 deletions
+5 -1
View File
@@ -37,12 +37,16 @@ type SendState = "idle" | "sending" | "sent";
export function ShareToChatDialog({
body = "",
quote,
entity,
onClose,
}: {
/** Plain message text. Empty when sending a quote on its own. */
body?: string;
/** A passage from the library, sent as a tappable quotation. */
quote?: QuotePayload;
/** A post, sent as a card. Only the reference travels — the BFF resolves
* the contents and re-checks visibility for each viewer. */
entity?: { type: "post"; id: string };
onClose: () => void;
}) {
const { user } = useAuth();
@@ -111,7 +115,7 @@ export function ShareToChatDialog({
mark(handle, "sending");
try {
const id = conversationId ?? (await chat.openDM(handle)).id;
await chat.send(id, body, { quote });
await chat.send(id, body, { quote, entity });
mark(handle, "sent");
} catch {
mark(handle, "idle");