Commit 03907f9a authored by Danny Liu's avatar Danny Liu
Browse files

check if deleted message response has sibling responses for multi model chats

parent 8c011974
......@@ -228,10 +228,12 @@
const messageParentId = messageToDelete.parentId;
const messageChildrenIds = messageToDelete.childrenIds ?? [];
const hasSibling = messageChildrenIds.some(childId => history.messages[childId]?.childrenIds?.length > 0);
messageChildrenIds.forEach((childId) => {
const child = history.messages[childId];
if (child && child.childrenIds) {
if (child.childrenIds.length == 0) { // if last prompt/response pair
if (child.childrenIds.length === 0 && !hasSibling) { // if last prompt/response pair
history.messages[messageParentId].childrenIds = []
history.currentId = messageParentId;
}
......
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