mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
Add auto redirect on delete of current conversation
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user