Skip to content
Snippets Groups Projects
Unverified Commit f32550c6 authored by Nick Fitzpatrick's avatar Nick Fitzpatrick Committed by GitHub
Browse files

Fixing null error when value is null and isCustom is true (#24517)

* Fixing null error when value is null and isCustom is true

* PR Feedback
parent bc09b89d
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ const PersistedModelRefreshIntervalWidget = ({
const [customCronSchedule, setCustomCronSchedule] = useState(
// We don't allow to specify the "year" component, but it's present in the value
// So we need to cut it visually to avoid confusion
isCustom ? formatCronExpression(setting.value) : "",
isCustom ? formatCronExpression(setting.value ?? setting.default) : "",
);
const handleScheduleChange = useCallback(
......@@ -49,6 +49,7 @@ const PersistedModelRefreshIntervalWidget = ({
if (nextValue === "custom") {
setCustom(true);
setCustomCronSchedule(DEFAULT_CUSTOM_SCHEDULE);
onChange(`0 ${DEFAULT_CUSTOM_SCHEDULE} *`);
} else {
setCustom(false);
setCustomCronSchedule("");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment