()
| 216 | |
| 217 | // Build drafts cache from localStorage (for sidebar display) |
| 218 | export function buildDraftsCache(): Record<string, string> { |
| 219 | const globalDrafts = loadGlobalDrafts() |
| 220 | const cache: Record<string, string> = {} |
| 221 | for (const [key, value] of Object.entries(globalDrafts)) { |
| 222 | if ((value as DraftContent)?.text) { |
| 223 | cache[key] = (value as DraftContent).text |
| 224 | } |
| 225 | } |
| 226 | return cache |
| 227 | } |
| 228 | |
| 229 | /** |
| 230 | * Hook to get new chat drafts with automatic updates |
no test coverage detected