Bugfix/In-mem VS not able to load document (#2542)

fix where in-mem VS not able to load document
pull/2543/head flowise-components@1.8.1
Henry Heng 2024-05-31 23:41:21 +01:00 committed by GitHub
parent 04e0ce1783
commit 6a58ae4e80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -379,6 +379,7 @@ export const saveUpsertFlowData = (nodeData: INodeData, upsertHistory: Record<st
/**
* Check if doc loader should be bypassed, ONLY if doc loader is connected to a vector store
* Reason being we dont want to load the doc loader again whenever we are building the flow, because it was already done during upserting
* EXCEPT if the vector store is a memory vector store
* TODO: Remove this logic when we remove doc loader nodes from the canvas
* @param {IReactFlowNode} reactFlowNode
* @param {IReactFlowNode[]} reactFlowNodes
@ -406,7 +407,8 @@ const checkIfDocLoaderShouldBeIgnored = (
if (targetNodeId) {
const targetNodeCategory = reactFlowNodes.find((nd) => nd.id === targetNodeId)?.data.category || ''
if (targetNodeCategory === 'Vector Stores') {
const targetNodeName = reactFlowNodes.find((nd) => nd.id === targetNodeId)?.data.name || ''
if (targetNodeCategory === 'Vector Stores' && targetNodeName !== 'memoryVectorStore') {
return true
}
}