mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-03 21:29:08 +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:
@@ -32,8 +32,7 @@ interface ChatBodyDataProps {
|
||||
|
||||
function ChatBodyData(props: ChatBodyDataProps) {
|
||||
const searchParams = useSearchParams();
|
||||
const conversationUniqueId = searchParams.get("v");
|
||||
const [conversationId, setConversationId] = useState<string | null>("");
|
||||
const conversationId = searchParams.get("conversationId");
|
||||
const [message, setMessage] = useState("");
|
||||
const [image, setImage] = useState<string | null>(null);
|
||||
const [processingMessage, setProcessingMessage] = useState(false);
|
||||
@@ -61,11 +60,6 @@ function ChatBodyData(props: ChatBodyDataProps) {
|
||||
setProcessingMessage(true);
|
||||
setQueryToProcess(storedMessage);
|
||||
}
|
||||
|
||||
const conversationId = localStorage.getItem("conversationId");
|
||||
if (conversationId) {
|
||||
setConversationId(conversationId);
|
||||
}
|
||||
}, [setQueryToProcess]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -75,30 +69,6 @@ function ChatBodyData(props: ChatBodyDataProps) {
|
||||
}
|
||||
}, [message, setQueryToProcess]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!conversationUniqueId) {
|
||||
return;
|
||||
}
|
||||
|
||||
fetch(
|
||||
`/api/chat/metadata?conversation_unique_id=${encodeURIComponent(conversationUniqueId)}`,
|
||||
)
|
||||
.then((response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error(response.statusText);
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then((data) => {
|
||||
setConversationId(data.conversationId);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
setConversationId(null);
|
||||
return;
|
||||
});
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (conversationId) {
|
||||
onConversationIdChange?.(conversationId);
|
||||
@@ -117,15 +87,11 @@ function ChatBodyData(props: ChatBodyDataProps) {
|
||||
}
|
||||
}, [props.streamedMessages]);
|
||||
|
||||
if (!conversationUniqueId || conversationId === null) {
|
||||
if (!conversationId) {
|
||||
window.location.href = "/";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!conversationId) {
|
||||
return <Loading />;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={false ? styles.chatBody : styles.chatBodyFull}>
|
||||
|
||||
Reference in New Issue
Block a user