fix: memories not visible when sending from outside io modal (#2987)
* Fixed names and unused params * Added refetch of memories
This commit is contained in:
parent
9ac861da2f
commit
83910866e9
3 changed files with 13 additions and 19 deletions
|
|
@ -21,7 +21,7 @@ import UploadFileButton from "./components/uploadFileButton";
|
|||
import { getClassNamesFilePreview } from "./helpers/get-class-file-preview";
|
||||
import useAutoResizeTextArea from "./hooks/use-auto-resize-text-area";
|
||||
import useFocusOnUnlock from "./hooks/use-focus-unlock";
|
||||
export default function ChattInput({
|
||||
export default function ChatInput({
|
||||
lockChat,
|
||||
chatValue,
|
||||
sendMessage,
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import { deleteFlowPool } from "../../../../controllers/API";
|
|||
import useAlertStore from "../../../../stores/alertStore";
|
||||
import useFlowStore from "../../../../stores/flowStore";
|
||||
import useFlowsManagerStore from "../../../../stores/flowsManagerStore";
|
||||
import { VertexBuildTypeAPI, sendAllProps } from "../../../../types/api";
|
||||
import { VertexBuildTypeAPI } from "../../../../types/api";
|
||||
import { ChatMessageType } from "../../../../types/chat";
|
||||
import { FilePreviewType, chatViewProps } from "../../../../types/components";
|
||||
import { classNames } from "../../../../utils/utils";
|
||||
|
|
@ -149,12 +149,7 @@ export default function ChatView({
|
|||
const [files, setFiles] = useState<FilePreviewType[]>([]);
|
||||
const [isDragging, setIsDragging] = useState(false);
|
||||
|
||||
const { dragOver, dragEnter, dragLeave } = useDragAndDrop(
|
||||
setIsDragging,
|
||||
setFiles,
|
||||
currentFlowId,
|
||||
setErrorData,
|
||||
);
|
||||
const { dragOver, dragEnter, dragLeave } = useDragAndDrop(setIsDragging);
|
||||
|
||||
const onDrop = (e) => {
|
||||
e.preventDefault();
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import {
|
|||
useDeleteMessages,
|
||||
useGetMessagesQuery,
|
||||
} from "@/controllers/API/queries/messages";
|
||||
import { useQueryClient } from "@tanstack/react-query";
|
||||
import { useEffect, useState } from "react";
|
||||
import AccordionComponent from "../../components/accordionComponent";
|
||||
import IconComponent from "../../components/genericIconComponent";
|
||||
|
|
@ -22,7 +21,7 @@ import useFlowStore from "../../stores/flowStore";
|
|||
import useFlowsManagerStore from "../../stores/flowsManagerStore";
|
||||
import { useMessagesStore } from "../../stores/messagesStore";
|
||||
import { IOModalPropsType } from "../../types/components";
|
||||
import { NodeDataType, NodeType } from "../../types/flow";
|
||||
import { NodeType } from "../../types/flow";
|
||||
import { cn } from "../../utils/utils";
|
||||
import BaseModal from "../baseModal";
|
||||
import IOFieldView from "./components/IOFieldView";
|
||||
|
|
@ -158,15 +157,9 @@ export default function IOModal({
|
|||
setSelectedTab(inputs.length > 0 ? 1 : outputs.length > 0 ? 2 : 0);
|
||||
}, [allNodes.length]);
|
||||
|
||||
const flow_sessions = allNodes.map((node) => {
|
||||
if ((node.data as NodeDataType).node?.template["session_id"]) {
|
||||
return {
|
||||
id: node.id,
|
||||
session_id: (node.data as NodeDataType).node?.template["session_id"]
|
||||
.value,
|
||||
};
|
||||
}
|
||||
});
|
||||
useEffect(() => {
|
||||
refetch();
|
||||
}, [open]);
|
||||
|
||||
useEffect(() => {
|
||||
const sessions = new Set<string>();
|
||||
|
|
@ -364,6 +357,7 @@ export default function IOModal({
|
|||
{sessions.map((session, index) => {
|
||||
return (
|
||||
<div
|
||||
key={index}
|
||||
className="file-component-accordion-div cursor-pointer"
|
||||
onClick={(event) => {
|
||||
event.stopPropagation();
|
||||
|
|
@ -441,6 +435,11 @@ export default function IOModal({
|
|||
</div>
|
||||
);
|
||||
})}
|
||||
{!sessions.length && (
|
||||
<span className="text-sm text-muted-foreground">
|
||||
No memories available.
|
||||
</span>
|
||||
)}
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue