fix re-generate only delete assistant message

This commit is contained in:
2023-07-27 10:26:55 +08:00
parent 1c34c123aa
commit 5f0481fece

View File

@@ -460,7 +460,9 @@ export default function ChatBOX(props: {
disabled={showGenerating || !chatStore.apiKey} disabled={showGenerating || !chatStore.apiKey}
onClick={async () => { onClick={async () => {
const messageIndex = chatStore.history.length - 1; const messageIndex = chatStore.history.length - 1;
if (chatStore.history[messageIndex].role === "assistant") {
chatStore.history[messageIndex].hide = true; chatStore.history[messageIndex].hide = true;
}
//chatStore.totalTokens = //chatStore.totalTokens =
update_total_tokens(); update_total_tokens();