mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Delete vectors on deleting chats
This commit is contained in:
@ -816,12 +816,20 @@ function activateNaturalOrder(members, input, lastMessage, allowSelfResponses, i
|
||||
}
|
||||
|
||||
async function deleteGroup(id) {
|
||||
const group = groups.find((x) => x.id === id);
|
||||
|
||||
const response = await fetch("/deletegroup", {
|
||||
method: "POST",
|
||||
headers: getRequestHeaders(),
|
||||
body: JSON.stringify({ id: id }),
|
||||
});
|
||||
|
||||
if (group && Array.isArray(group.chats)) {
|
||||
for (const chatId of group.chats) {
|
||||
await eventSource.emit(event_types.GROUP_CHAT_DELETED, chatId);
|
||||
}
|
||||
}
|
||||
|
||||
if (response.ok) {
|
||||
selected_group = null;
|
||||
delete tag_map[id];
|
||||
@ -1493,6 +1501,8 @@ export async function deleteGroupChat(groupId, chatId) {
|
||||
} else {
|
||||
await createNewGroupChat(groupId);
|
||||
}
|
||||
|
||||
await eventSource.emit(event_types.GROUP_CHAT_DELETED, chatId);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user