fix: Stop listening button not working in NDV (#9023)

This commit is contained in:
Milorad FIlipović
2024-04-03 12:16:16 +02:00
committed by कारतोफ्फेलस्क्रिप्ट™
parent e2bde6b751
commit 02219dde2f
5 changed files with 85 additions and 67 deletions

View File

@@ -77,18 +77,20 @@ export default defineComponent({
type: Boolean,
},
},
emits: ['stopExecution', 'execute'],
setup(props) {
const router = useRouter();
const workflowsStore = useWorkflowsStore();
const node = workflowsStore.getNodeByName(props.nodeName);
const pinnedData = usePinnedData(node);
const externalHooks = useExternalHooks();
const { runWorkflow } = useRunWorkflow({ router });
const { runWorkflow, stopCurrentExecution } = useRunWorkflow({ router });
return {
externalHooks,
pinnedData,
runWorkflow,
stopCurrentExecution,
...useToast(),
...useMessage(),
};
@@ -236,6 +238,7 @@ export default defineComponent({
} else if (this.isListeningForEvents) {
await this.stopWaitingForWebhook();
} else if (this.isListeningForWorkflowEvents) {
await this.stopCurrentExecution();
this.$emit('stopExecution');
} else {
let shouldUnpinAndExecute = false;