diff --git a/packages/frontend/editor-ui/src/composables/usePushConnection/usePushConnection.ts b/packages/frontend/editor-ui/src/composables/usePushConnection/usePushConnection.ts index fbe94c0d6c3..54b55cf39f8 100644 --- a/packages/frontend/editor-ui/src/composables/usePushConnection/usePushConnection.ts +++ b/packages/frontend/editor-ui/src/composables/usePushConnection/usePushConnection.ts @@ -21,7 +21,7 @@ import { workflowActivated, workflowDeactivated, } from '@/composables/usePushConnection/handlers'; -import { useWorkflowState, type WorkflowState } from '@/composables/useWorkflowState'; +import { injectWorkflowState, type WorkflowState } from '@/composables/useWorkflowState'; import { createEventQueue } from '@n8n/utils/event-queue'; import type { useRouter } from 'vue-router'; @@ -35,7 +35,7 @@ export function usePushConnection({ const pushStore = usePushConnectionStore(); const options = { router, - workflowState: workflowState ?? useWorkflowState(), + workflowState: workflowState ?? injectWorkflowState(), }; const { enqueue } = createEventQueue(processEvent); diff --git a/packages/frontend/editor-ui/src/composables/useWorkflowSaving.ts b/packages/frontend/editor-ui/src/composables/useWorkflowSaving.ts index 65ffa804e59..63a0a303f17 100644 --- a/packages/frontend/editor-ui/src/composables/useWorkflowSaving.ts +++ b/packages/frontend/editor-ui/src/composables/useWorkflowSaving.ts @@ -27,7 +27,7 @@ import { useNodeHelpers } from './useNodeHelpers'; import { tryToParseNumber } from '@/utils/typesUtils'; import { useTemplatesStore } from '@/stores/templates.store'; import { useFocusPanelStore } from '@/stores/focusPanel.store'; -import { useWorkflowState } from './useWorkflowState'; +import { injectWorkflowState } from './useWorkflowState'; export function useWorkflowSaving({ router }: { router: ReturnType }) { const uiStore = useUIStore(); @@ -35,7 +35,7 @@ export function useWorkflowSaving({ router }: { router: ReturnType { - console.error('Attempted to inject workflowState outside of NodeView tree'); + // While we're migrating we're happy to fall back onto a separate instance since + // all data is still stored in the workflowsStore + // Once we're ready to move the actual refs to `useWorkflowState` we should error here + // to track down remaining usages that would break + // console.error('Attempted to inject workflowState outside of NodeView tree'); return useWorkflowState(); }, true,