+5
-4
@@ -14,17 +14,18 @@ import {
|
||||
computeStepOutputSchema,
|
||||
shouldComputeOutputSchemaOnFrontend,
|
||||
} from '@/workflow/workflow-variables/utils/generate/computeStepOutputSchema';
|
||||
import { useStore } from 'jotai';
|
||||
import { useRecoilCallback } from 'recoil';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { TRIGGER_STEP_ID } from 'twenty-shared/workflow';
|
||||
|
||||
export const useStepsOutputSchema = () => {
|
||||
const store = useStore();
|
||||
|
||||
const populateStepsOutputSchema = useRecoilCallback(
|
||||
({ set, snapshot }) =>
|
||||
(workflowVersion: WorkflowVersion) => {
|
||||
const objectMetadataItems = snapshot
|
||||
.getLoadable(objectMetadataItemsState)
|
||||
.getValue();
|
||||
const objectMetadataItems = store.get(objectMetadataItemsState.atom);
|
||||
|
||||
workflowVersion.steps?.forEach((step) => {
|
||||
const stepKey = getStepOutputSchemaFamilyStateKey(
|
||||
@@ -108,7 +109,7 @@ export const useStepsOutputSchema = () => {
|
||||
set(shouldRecomputeOutputSchemaFamilyState(triggerKey), false);
|
||||
}
|
||||
},
|
||||
[],
|
||||
[store],
|
||||
);
|
||||
|
||||
const markStepForRecomputation = useRecoilCallback(
|
||||
|
||||
Reference in New Issue
Block a user