diff --git a/app/store/chat.ts b/app/store/chat.ts index 07bfae676..048dbe31e 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -131,9 +131,9 @@ export const useChatStore = create()( }, removeSession(index: number) { - set(() => { - let selectedIndex = get().currentSessionIndex; - const sessions = get().sessions; + set((state) => { + let selectedIndex = state.currentSessionIndex; + const sessions = state.sessions; if (sessions.length === 1) { return {