(workspaceId: string, threadId: string, name: string)
| 126 | } |
| 127 | |
| 128 | export function saveCustomName(workspaceId: string, threadId: string, name: string): void { |
| 129 | if (typeof window === "undefined") { |
| 130 | return; |
| 131 | } |
| 132 | try { |
| 133 | const current = loadCustomNames(); |
| 134 | const key = makeCustomNameKey(workspaceId, threadId); |
| 135 | current[key] = name; |
| 136 | window.localStorage.setItem( |
| 137 | STORAGE_KEY_CUSTOM_NAMES, |
| 138 | JSON.stringify(current), |
| 139 | ); |
| 140 | } catch { |
| 141 | // Best-effort persistence. |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | export function makePinKey(workspaceId: string, threadId: string): string { |
| 146 | return `${workspaceId}:${threadId}`; |
no test coverage detected