(sessionId: string, newName: string)
| 339 | } |
| 340 | |
| 341 | async function handleRenameSession(sessionId: string, newName: string) { |
| 342 | const trimmed = newName.trim(); |
| 343 | if (!trimmed) return; |
| 344 | try { |
| 345 | await api('/api/sessions/rename', { |
| 346 | method: 'POST', |
| 347 | body: { sessionId, summary: trimmed }, |
| 348 | }); |
| 349 | } catch (error) { |
| 350 | setErrorMessage(error instanceof Error ? error.message : String(error)); |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | function handleDeleteSession(sessionId: string, currentName: string) { |
| 355 | setDeleteConfirm({ sessionId, name: currentName }); |