fix: chat accepts posts
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user