mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-03 05:29:12 +00:00
Revert "Convert conversationId int to string before making api request to bulk update file filters"
This reverts commitc9665fb20b. Revert "Fix handling for new conversation in agents page" This reverts commit3466f04992. Revert "Add a unique_id field for identifiying conversations (#914)" This reverts commitece2ec2d90.
This commit is contained in:
@@ -38,7 +38,6 @@ import { getIconFromIconName } from "../common/iconUtils";
|
||||
import { convertColorToTextClass } from "../common/colorUtils";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { useIsMobileWidth } from "../common/utils";
|
||||
import { createNewConversation } from "../common/chatFunctions";
|
||||
|
||||
export interface AgentData {
|
||||
slug: string;
|
||||
@@ -56,10 +55,13 @@ async function openChat(slug: string, userData: UserProfile | null) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await createNewConversation(slug);
|
||||
window.location.href = `/chat?v=${response.conversationUniqueId}`;
|
||||
} catch (error) {
|
||||
const response = await fetch(`/api/chat/sessions?agent_slug=${slug}`, { method: "POST" });
|
||||
const data = await response.json();
|
||||
if (response.status == 200) {
|
||||
window.location.href = `/chat?conversationId=${data.conversation_id}`;
|
||||
} else if (response.status == 403 || response.status == 401) {
|
||||
window.location.href = unauthenticatedRedirectUrl;
|
||||
} else {
|
||||
alert("Failed to start chat session");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user