mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix: Prevent chat modal opening on 'Test workflow' click (#9009)
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com> Co-authored-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
@@ -247,6 +247,33 @@ export function useRunWorkflow(options: { router: ReturnType<typeof useRouter> }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//if no destination node is specified
|
||||
//and execution is not triggered from chat
|
||||
//and there are other triggers in the workflow
|
||||
//disable chat trigger node to avoid modal opening and webhook creation
|
||||
if (
|
||||
!options.destinationNode &&
|
||||
options.source !== 'RunData.ManualChatMessage' &&
|
||||
workflowData.nodes.some((node) => node.type === CHAT_TRIGGER_NODE_TYPE)
|
||||
) {
|
||||
const otherTriggers = workflowData.nodes.filter(
|
||||
(node) =>
|
||||
node.type !== CHAT_TRIGGER_NODE_TYPE &&
|
||||
node.type.toLowerCase().includes('trigger') &&
|
||||
!node.disabled,
|
||||
);
|
||||
|
||||
if (otherTriggers.length) {
|
||||
const chatTriggerNode = workflowData.nodes.find(
|
||||
(node) => node.type === CHAT_TRIGGER_NODE_TYPE,
|
||||
);
|
||||
if (chatTriggerNode) {
|
||||
chatTriggerNode.disabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const startNodes: StartNodeData[] = startNodeNames.map((name) => {
|
||||
// Find for each start node the source data
|
||||
let sourceData = get(runData, [name, 0, 'source', 0], null);
|
||||
|
||||
Reference in New Issue
Block a user