diff --git a/src/sql/QueryEditor/FillValueSelect.tsx b/src/sql/QueryEditor/FillValueSelect.tsx index f26a30b..bed8a6e 100644 --- a/src/sql/QueryEditor/FillValueSelect.tsx +++ b/src/sql/QueryEditor/FillValueSelect.tsx @@ -26,7 +26,7 @@ export const SelectableFillValueOptions: Array export type FillValueSelectProps = { query: TQuery; onChange: (value: TQuery) => void; - onRunQuery: () => void; + onRunQuery?: () => void; }; export function FillValueSelect>(props: FillValueSelectProps) { @@ -43,7 +43,7 @@ export function FillValueSelect>( // Keep the fillMode.value in case FillValueOptions.Value mode is selected back fillMode: { ...props.query.fillMode, mode: value }, }); - props.onRunQuery(); + props.onRunQuery?.(); }} className="width-12" menuShouldPortal={true} @@ -64,7 +64,7 @@ export function FillValueSelect>( }, }) } - onBlur={() => props.onRunQuery()} + onBlur={() => props.onRunQuery?.()} /> )} diff --git a/src/sql/QueryEditor/FormatSelect.tsx b/src/sql/QueryEditor/FormatSelect.tsx index c1e7819..af55cfa 100644 --- a/src/sql/QueryEditor/FormatSelect.tsx +++ b/src/sql/QueryEditor/FormatSelect.tsx @@ -6,7 +6,7 @@ export type FormatSelectProps = { query: TQuery; options: Array>; onChange: (value: TQuery) => void; - onRunQuery: () => void; + onRunQuery?: () => void; }; export function FormatSelect, FormatOptions>( @@ -17,7 +17,7 @@ export function FormatSelect, For ...props.query, format: e.value || 0, }); - props.onRunQuery(); + props.onRunQuery?.(); }; return (