fix re-generate only delete assistant message
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user