From d439c2d6d973579669c0a0c61f7f66aa59ed6a7a Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Wed, 7 Jun 2023 01:18:05 +0800 Subject: [PATCH] fix: #1685 clear context index should be recoverable --- app/components/chat.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 5dd276c0dad..70fd462d9fd 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -265,7 +265,7 @@ function ClearContextDivider() { className={chatStyle["clear-context"]} onClick={() => chatStore.updateCurrentSession( - (session) => (session.clearContextIndex = -1), + (session) => (session.clearContextIndex = undefined), ) } > @@ -388,7 +388,7 @@ export function ChatActions(props: { onClick={() => { chatStore.updateCurrentSession((session) => { if (session.clearContextIndex === session.messages.length) { - session.clearContextIndex = -1; + session.clearContextIndex = undefined; } else { session.clearContextIndex = session.messages.length; session.memoryPrompt = ""; // will clear memory