File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -367,8 +367,10 @@ export const MemoChart = memo(function MemoChart({
367367
368368 const [ isHovered , setIsHovered ] = useState ( false ) ;
369369
370- const ChartComponent =
371- displayType === DisplayType . StackedBar ? BarChart : AreaChart ; // LineChart;
370+ const ChartComponent = useMemo (
371+ ( ) => ( displayType === DisplayType . StackedBar ? BarChart : AreaChart ) , // LineChart;
372+ [ displayType ] ,
373+ ) ;
372374
373375 const lines = useMemo ( ( ) => {
374376 const hasSelection = selectedSeriesNames && selectedSeriesNames . size > 0 ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import {
1010 useCompleteKeyValues ,
1111 useMultipleAllFields ,
1212} from '@/hooks/useMetadata' ;
13- import { toArray } from '@/utils' ;
13+ import { toArray , useDebounce } from '@/utils' ;
1414
1515export type TokenInfo = {
1616 /** The full token at the cursor position */
@@ -46,7 +46,7 @@ export interface ILanguageFormatter {
4646
4747export function useAutoCompleteOptions (
4848 formatter : ILanguageFormatter ,
49- value : string ,
49+ _value : string ,
5050 {
5151 tableConnection,
5252 additionalSuggestions,
@@ -59,6 +59,7 @@ export function useAutoCompleteOptions(
5959 inputRef ?: React . RefObject < HTMLTextAreaElement | null > ;
6060 } ,
6161) {
62+ const value = useDebounce ( _value , 300 ) ;
6263 const tcs = useMemo ( ( ) => toArray ( tableConnection ) , [ tableConnection ] ) ;
6364
6465 const effectiveDateRange : [ Date , Date ] = useMemo (
You can’t perform that action at this time.
0 commit comments