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