Files
cobble/src/pages/admin/bots/[bot_id]/(utils)/composer-draft-key.ts
T
tbenandClaude Opus 5.5 6c1399f88f Keep composer drafts across reloads and preview attached images
The composer's unsent text and uploaded files are kept in localStorage
per bot and workspace until sent. Picked images show a small preview in
place of their icon.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 14:18:13 +01:00

15 lines
421 B
TypeScript

import { AppData } from "@/src/data/app-data";
type Params = {
bot_id?: number | "" | null;
workspace_id?: number | null;
part: "text" | "files";
};
/**
* The `localStorage` key of one part of a conversation's unsent draft.
*/
export default function composerDraftKey({ bot_id, workspace_id, part }: Params) {
return `${AppData.ComposerDraftStorageKey}:${bot_id || 0}:${workspace_id || 0}:${part}`;
}