mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(editor): Refactor usePushConnection and introduce new queueing system (#14529)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import type { ExecutionStarted } from '@n8n/api-types/push/execution';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { parse } from 'flatted';
|
||||
|
||||
/**
|
||||
* Handles the 'executionStarted' event, which happens when a workflow is executed.
|
||||
*/
|
||||
export async function executionStarted({ data }: ExecutionStarted) {
|
||||
const workflowsStore = useWorkflowsStore();
|
||||
|
||||
// No workflow execution is ongoing, so we can ignore this event
|
||||
if (typeof workflowsStore.activeExecutionId === 'undefined') {
|
||||
return;
|
||||
} else if (workflowsStore.activeExecutionId === null) {
|
||||
workflowsStore.setActiveExecutionId(data.executionId);
|
||||
}
|
||||
|
||||
if (workflowsStore.workflowExecutionData?.data && data.flattedRunData) {
|
||||
workflowsStore.workflowExecutionData.data.resultData.runData = parse(data.flattedRunData);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user