(sessionId: string)
| 42 | * Sync session data to new Store |
| 43 | */ |
| 44 | export function syncSessionToModernStore(sessionId: string): void { |
| 45 | const oldState = flowChatStore.getState(); |
| 46 | const session = oldState.sessions.get(sessionId); |
| 47 | |
| 48 | if (!session) { |
| 49 | log.warn('Session not found', { sessionId }); |
| 50 | return; |
| 51 | } |
| 52 | |
| 53 | const modernStore = useModernFlowChatStore.getState(); |
| 54 | if (isSessionAlreadySynced(sessionId, session, modernStore)) { |
| 55 | return; |
| 56 | } |
| 57 | modernStore.setActiveSession(session); |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Start auto sync |
no test coverage detected