(state: AIChatSessionState, fromKey: string, toKey: string)
| 393 | } |
| 394 | |
| 395 | function renameBufferKey(state: AIChatSessionState, fromKey: string, toKey: string): AIChatBuffer { |
| 396 | const buffer = getOrCreateBuffer(state, fromKey) |
| 397 | state.aiChatBuffers[toKey] = buffer |
| 398 | if (fromKey !== toKey) { |
| 399 | delete state.aiChatBuffers[fromKey] |
| 400 | } |
| 401 | if (state.currentAIChatId === null && fromKey === DRAFT_AI_CHAT_KEY) { |
| 402 | state.currentAIChatId = toKey |
| 403 | } |
| 404 | return buffer |
| 405 | } |
| 406 | |
| 407 | function applySessionAssistantSelection(chatKey: string): void { |
| 408 | const state = getSessionState(chatKey) |
no test coverage detected