(sessionId: string)
| 243 | |
| 244 | // Archive session |
| 245 | const handleArchiveSession = async (sessionId: string) => { |
| 246 | const api = getElectronAPI(); |
| 247 | if (!api?.sessions) { |
| 248 | logger.error('[SessionManager] Sessions API not available'); |
| 249 | return; |
| 250 | } |
| 251 | |
| 252 | try { |
| 253 | const result = await api.sessions.archive(sessionId); |
| 254 | if (result.success) { |
| 255 | // If the archived session was currently selected, deselect it |
| 256 | if (currentSessionId === sessionId) { |
| 257 | onSelectSession(null); |
| 258 | } |
| 259 | await invalidateSessions(); |
| 260 | } else { |
| 261 | logger.error('[SessionManager] Archive failed:', result.error); |
| 262 | } |
| 263 | } catch (error) { |
| 264 | logger.error('[SessionManager] Archive error:', error); |
| 265 | } |
| 266 | }; |
| 267 | |
| 268 | // Unarchive session |
| 269 | const handleUnarchiveSession = async (sessionId: string) => { |
no test coverage detected