Skip to content

Commit 427ec06

Browse files
committed
Add auto redirect on delete of current conversation
1 parent bbb5fd6 commit 427ec06

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/interface/web/app/components/allConversations/allConversations.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,12 @@ function deleteConversation(conversationId: string) {
164164
})
165165
.then((response) => {
166166
response.json();
167-
mutate("/api/chat/sessions");
167+
// If currently viewing the conversation, redirect to the home page
168+
if (window.location.search.includes(`conversationId=${conversationId}`)) {
169+
window.location.href = "/";
170+
} else {
171+
mutate("/api/chat/sessions");
172+
}
168173
})
169174
.then((data) => { })
170175
.catch((err) => {

0 commit comments

Comments
 (0)