Skip to content

Commit

Permalink
add ?. just in case
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro committed Jan 3, 2023
1 parent 1f3762d commit b93d6e3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ const time_grain_sqla: SharedControlConfig<'SelectControl'> = {
// If a chart is a new one that isn't saved, metadata is null. In this
// case we want to default P1D. If the chart has been saved, we want
// to use whichever value was chosen, either nothing or valid a time grain.
return state.metadata || 'time_grain_sqla' in (state?.form_data ?? {})
? state.form_data?.time_grain_sqla
return state?.metadata || 'time_grain_sqla' in (state?.form_data ?? {})
? state?.form_data?.time_grain_sqla
: 'P1D';
},
description: t(
Expand Down

0 comments on commit b93d6e3

Please sign in to comment.