Add auto redirect on delete of current conversation

This commit is contained in:
sabaimran
2025-02-09 11:38:44 -08:00
parent bbb5fd667a
commit 427ec061b4

View File

@@ -164,7 +164,12 @@ function deleteConversation(conversationId: string) {
})
.then((response) => {
response.json();
mutate("/api/chat/sessions");
// If currently viewing the conversation, redirect to the home page
if (window.location.search.includes(`conversationId=${conversationId}`)) {
window.location.href = "/";
} else {
mutate("/api/chat/sessions");
}
})
.then((data) => { })
.catch((err) => {