Skip to content

Commit 2fdb35b

Browse files
author
李超
committed
fix: 解决会话列表按最新操作时间倒序排序,当前会话判断失败的bug
1 parent d0b7ddc commit 2fdb35b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/store/chat.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ export const useChatStore = createPersistStore(
345345
new Date(b.lastUpdate).getTime() - new Date(a.lastUpdate).getTime(),
346346
);
347347
const currentSessionIndex = sessions.findIndex((session) => {
348-
return session && currentSession && session.id === session.id;
348+
return session && currentSession && session.id === currentSession.id;
349349
});
350350

351351
set((state) => ({

app/utils/sync.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ const MergeStates: StateMerger = {
150150

151151
localState.currentSessionIndex = localState.sessions.findIndex(
152152
(session) => {
153-
return session && currentSession && session.id === session.id;
153+
return session && currentSession && session.id === currentSession.id;
154154
},
155155
);
156156

0 commit comments

Comments
 (0)