From 1270568a08a175197b5284926709fb0474eb1e69 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Thu, 20 Jul 2023 11:36:07 +0800 Subject: [PATCH] fix clear history with example --- src/settings.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/settings.tsx b/src/settings.tsx index c25637f..4fd2c78 100644 --- a/src/settings.tsx +++ b/src/settings.tsx @@ -209,9 +209,10 @@ export default (props: { ) ) return; - props.chatStore.history = []; + props.chatStore.history = props.chatStore.history.filter( + (msg) => msg.example && !msg.hide + ); props.chatStore.postBeginIndex = 0; - props.chatStore.totalTokens = 0; props.setChatStore({ ...props.chatStore }); }} >