add new check for overrideconfig to fix bug where external prediction call reset flow

This commit is contained in:
Henry 2023-05-10 23:33:19 +01:00
parent 24ceeb8671
commit d83b57c349
2 changed files with 6 additions and 2 deletions

View File

@ -378,7 +378,6 @@ export class App {
nodeToExecuteData = this.chatflowPool.activeChatflows[chatflowid].endingNodeData
} else {
/*** Get chatflows and prepare data ***/
const flowData = chatflow.flowData
const parsedFlowData: IReactFlowObject = JSON.parse(flowData)
const nodes = parsedFlowData.nodes

View File

@ -398,15 +398,20 @@ export const isSameOverrideConfig = (
existingOverrideConfig?: ICommonObject,
newOverrideConfig?: ICommonObject
): boolean => {
// Skip check if its internal call
if (isInternal) return true
// If existing and new overrideconfig are the same
if (
existingOverrideConfig &&
Object.keys(existingOverrideConfig).length &&
newOverrideConfig &&
Object.keys(newOverrideConfig).length &&
JSON.stringify(existingOverrideConfig) === JSON.stringify(newOverrideConfig)
)
) {
return true
}
// If there is no existing and new overrideconfig
if (!existingOverrideConfig && !newOverrideConfig) return true
return false
}