fix: 解决会话列表按最新操作时间倒序排序,当前会话判断失败的bug
This commit is contained in:
parent
d0b7ddc1d6
commit
2fdb35bcc8
|
@ -345,7 +345,7 @@ export const useChatStore = createPersistStore(
|
||||||
new Date(b.lastUpdate).getTime() - new Date(a.lastUpdate).getTime(),
|
new Date(b.lastUpdate).getTime() - new Date(a.lastUpdate).getTime(),
|
||||||
);
|
);
|
||||||
const currentSessionIndex = sessions.findIndex((session) => {
|
const currentSessionIndex = sessions.findIndex((session) => {
|
||||||
return session && currentSession && session.id === session.id;
|
return session && currentSession && session.id === currentSession.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
set((state) => ({
|
set((state) => ({
|
||||||
|
|
|
@ -150,7 +150,7 @@ const MergeStates: StateMerger = {
|
||||||
|
|
||||||
localState.currentSessionIndex = localState.sessions.findIndex(
|
localState.currentSessionIndex = localState.sessions.findIndex(
|
||||||
(session) => {
|
(session) => {
|
||||||
return session && currentSession && session.id === session.id;
|
return session && currentSession && session.id === currentSession.id;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue