Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ const TriggerDAGForm = ({
const { t: translate } = useTranslation(["common", "components"]);
const [errors, setErrors] = useState<{ conf?: string; date?: unknown }>({});
const [formError, setFormError] = useState(false);
const [hasAppliedPrefill, setHasAppliedPrefill] = useState(false);
const initialParamsDict = useDagParams(dagId, open);
const { conf, initialParamDict, setConf, setInitialParamDict } = useParamStore();
const [unpause, setUnpause] = useState(true);
const [hasAppliedPrefill, setHasAppliedPrefill] = useState(false);
const { mutate: togglePause } = useTogglePause({ dagId });

const { control, handleSubmit, reset, watch } = useForm<DagRunTriggerParams>({
Expand Down Expand Up @@ -130,12 +130,12 @@ const TriggerDAGForm = ({
isPartitioned,
]);

// Automatically reset form when conf is fetched (only if no prefillConfig)
// Automatically reset form when conf is fetched
useEffect(() => {
if (conf && open && (!prefillConfig || hasAppliedPrefill)) {
reset((prevValues) => ({ ...prevValues, conf }));
}
}, [conf, hasAppliedPrefill, prefillConfig, open, reset]);
}, [conf, hasAppliedPrefill, open, prefillConfig, reset]);

const resetDateError = () => setErrors((prev) => ({ ...prev, date: undefined }));

Expand Down
Loading