fix bug where flow got restarted everytime
This commit is contained in:
parent
f0097c7f57
commit
a1539edadf
|
|
@ -368,7 +368,11 @@ export class App {
|
|||
if (
|
||||
Object.prototype.hasOwnProperty.call(this.chatflowPool.activeChatflows, chatflowid) &&
|
||||
this.chatflowPool.activeChatflows[chatflowid].inSync &&
|
||||
isSameOverrideConfig(this.chatflowPool.activeChatflows[chatflowid].overrideConfig, incomingInput.overrideConfig) &&
|
||||
isSameOverrideConfig(
|
||||
isInternal,
|
||||
this.chatflowPool.activeChatflows[chatflowid].overrideConfig,
|
||||
incomingInput.overrideConfig
|
||||
) &&
|
||||
!isStartNodeDependOnInput(this.chatflowPool.activeChatflows[chatflowid].startingNodes)
|
||||
) {
|
||||
nodeToExecuteData = this.chatflowPool.activeChatflows[chatflowid].endingNodeData
|
||||
|
|
|
|||
|
|
@ -388,11 +388,17 @@ export const isStartNodeDependOnInput = (startingNodes: IReactFlowNode[]): boole
|
|||
|
||||
/**
|
||||
* Rebuild flow if new override config is provided
|
||||
* @param {boolean} isInternal
|
||||
* @param {ICommonObject} existingOverrideConfig
|
||||
* @param {ICommonObject} newOverrideConfig
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export const isSameOverrideConfig = (existingOverrideConfig?: ICommonObject, newOverrideConfig?: ICommonObject): boolean => {
|
||||
export const isSameOverrideConfig = (
|
||||
isInternal: boolean,
|
||||
existingOverrideConfig?: ICommonObject,
|
||||
newOverrideConfig?: ICommonObject
|
||||
): boolean => {
|
||||
if (isInternal) return true
|
||||
if (
|
||||
existingOverrideConfig &&
|
||||
Object.keys(existingOverrideConfig).length &&
|
||||
|
|
|
|||
Loading…
Reference in New Issue