"sgl-kernel/vscode:/vscode.git/clone" did not exist on "a7d825fccc378e5876bac48b462035a7fedf667e"
Commit a655ccdd authored by Danny Liu's avatar Danny Liu
Browse files

only cancel chat completion if the deleted message is the most recently sent

parent 95b8edf6
...@@ -227,9 +227,13 @@ ...@@ -227,9 +227,13 @@
history.messages[messageId].deleted = true; history.messages[messageId].deleted = true;
history.messages[history.messages[messageId].childrenIds[0]].deleted = true; history.messages[history.messages[messageId].childrenIds[0]].deleted = true;
const responseId = history.messages[messageId].childrenIds[0];
if (history.messages[responseId].childrenIds.length === 0) {
await cancelChatCompletion(localStorage.token, chatId);
}
await updateChatById(localStorage.token, chatId, { history }); await updateChatById(localStorage.token, chatId, { history });
await chats.set(await getChatList(localStorage.token)); await chats.set(await getChatList(localStorage.token));
await cancelChatCompletion(localStorage.token, chatId);
}; };
</script> </script>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment