mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-09 06:50:24 +08:00
fix: new session should insert at top
This commit is contained in:
@@ -106,8 +106,8 @@ export const useChatStore = create<ChatStore>()(
|
||||
|
||||
newSession() {
|
||||
set((state) => ({
|
||||
currentSessionIndex: state.sessions.length,
|
||||
sessions: state.sessions.concat([createEmptySession()]),
|
||||
currentSessionIndex: 0,
|
||||
sessions: [createEmptySession()].concat(state.sessions),
|
||||
}));
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user