This commit is contained in:
k
2026-09-21 18:15:13 +02:00
parent 670d7f1dd1
commit 2a34d16b52
8 changed files with 23 additions and 14 deletions
+2 -1
View File
@@ -408,7 +408,7 @@ export function deleteShare(convId: string): void {
getDb().query("DELETE FROM shares WHERE conv_id = ?").run(convId);
}
export function getShareByPublic(publicId: string): { conv: ConversationRow; messages: MessageRow[]; authorName: string; authorAvatarUrl: string; sharedAt: number } | null {
export function getShareByPublic(publicId: string): { conv: ConversationRow; messages: MessageRow[]; authorName: string; authorAvatarUrl: string; archived: boolean; sharedAt: number } | null {
const d = getDb();
const s = d.query("SELECT * FROM shares WHERE public_id = ?").get(publicId) as { conv_id: string; created_at: number } | null;
if (!s) return null;
@@ -420,6 +420,7 @@ export function getShareByPublic(publicId: string): { conv: ConversationRow; mes
messages: getMessages(conv.id).filter((m) => m.role !== "system"),
authorName: author?.display_name || "Someone",
authorAvatarUrl: author?.avatar_url || "",
archived: conv.archived_at !== 0,
sharedAt: s.created_at,
};
}
+1
View File
@@ -201,6 +201,7 @@ const server = Bun.serve({
model: s.conv.model,
authorName: s.authorName,
authorAvatarUrl: s.authorAvatarUrl,
archived: s.archived,
sharedAt: s.sharedAt,
messages: s.messages.map((m) => ({ role: m.role, content: m.content })),
});