From c7965f0e6a804702cb7fb5b237e96a1c67a3c1cd Mon Sep 17 00:00:00 2001 From: jinmiaoluo <39730824+jinmiaoluo@users.noreply.github.com> Date: Sat, 29 Apr 2023 13:30:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=87=BD=E6=95=B0=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E9=A3=8E=E6=A0=BC=E8=AE=BF=E9=97=AE=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/chat.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 {