mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-09 02:05:59 +08:00
fix: #1363 session index after deleting
This commit is contained in:
@@ -180,8 +180,9 @@ export const useChatStore = create<ChatStore>()(
|
||||
const sessions = get().sessions.slice();
|
||||
sessions.splice(index, 1);
|
||||
|
||||
const currentIndex = get().currentSessionIndex;
|
||||
let nextIndex = Math.min(
|
||||
get().currentSessionIndex,
|
||||
currentIndex - Number(index < currentIndex),
|
||||
sessions.length - 1,
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user