mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-28 15:27:03 +02:00
fix(editor): Remove workflowState non-provided warning for now (no-changelog) (#20325)
This commit is contained in:
parent
bd67083931
commit
8b45f47db2
|
|
@ -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<PushMessage>(processEvent);
|
||||
|
|
|
|||
|
|
@ -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<typeof useRouter> }) {
|
||||
const uiStore = useUIStore();
|
||||
|
|
@ -35,7 +35,7 @@ export function useWorkflowSaving({ router }: { router: ReturnType<typeof useRou
|
|||
const message = useMessage();
|
||||
const i18n = useI18n();
|
||||
const workflowsStore = useWorkflowsStore();
|
||||
const workflowState = useWorkflowState();
|
||||
const workflowState = injectWorkflowState();
|
||||
const focusPanelStore = useFocusPanelStore();
|
||||
const nodeTypesStore = useNodeTypesStore();
|
||||
const toast = useToast();
|
||||
|
|
|
|||
|
|
@ -184,7 +184,11 @@ export function injectWorkflowState() {
|
|||
return inject(
|
||||
WorkflowStateKey,
|
||||
() => {
|
||||
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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user