diff --git a/app/store/chat.ts b/app/store/chat.ts index 4aa58a073..5db48d2c9 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -345,7 +345,7 @@ export const useChatStore = createPersistStore( new Date(b.lastUpdate).getTime() - new Date(a.lastUpdate).getTime(), ); const currentSessionIndex = sessions.findIndex((session) => { - return session && currentSession && session.id === session.id; + return session && currentSession && session.id === currentSession.id; }); set((state) => ({ diff --git a/app/utils/sync.ts b/app/utils/sync.ts index 576c18b58..645d8ac11 100644 --- a/app/utils/sync.ts +++ b/app/utils/sync.ts @@ -150,7 +150,7 @@ const MergeStates: StateMerger = { localState.currentSessionIndex = localState.sessions.findIndex( (session) => { - return session && currentSession && session.id === session.id; + return session && currentSession && session.id === currentSession.id; }, );