diff --git a/src/interface/web/app/components/allConversations/allConversations.tsx b/src/interface/web/app/components/allConversations/allConversations.tsx index 353f2dbb..0d1c1b88 100644 --- a/src/interface/web/app/components/allConversations/allConversations.tsx +++ b/src/interface/web/app/components/allConversations/allConversations.tsx @@ -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) => {