Skip to content

Commit

Permalink
fix broken dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
bobular committed Nov 19, 2024
1 parent 65004b3 commit c29fde8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ import { CoverageStatistics } from '../../../types/visualization';
// import axis label unit util
import { variableDisplayWithUnit } from '../../../utils/variable-display';
import {
NumberVariable,
DateVariable,
StudyEntity,
Variable,
Expand Down Expand Up @@ -477,8 +476,10 @@ function LineplotViz(props: VisualizationProps<Options>) {
vizConfig.dependentAxisLogScale,
vizConfig.independentAxisValueSpec,
vizConfig.dependentAxisValueSpec,
vizConfig.useBinning,
findEntityAndVariable,
updateVizConfig,
showMarginalHistogram,
]
);

Expand Down Expand Up @@ -1183,7 +1184,11 @@ function LineplotViz(props: VisualizationProps<Options>) {
});
// add reset for truncation message: including dependent axis warning as well
setTruncatedIndependentAxisWarning('');
}, [updateVizConfig, setTruncatedIndependentAxisWarning]);
}, [
updateVizConfig,
setTruncatedIndependentAxisWarning,
alwaysEnableUseBinning,
]);

const handleDependentAxisRangeChange = useCallback(
(newRange?: NumberOrDateRange) => {
Expand Down Expand Up @@ -1214,7 +1219,7 @@ function LineplotViz(props: VisualizationProps<Options>) {
});
// add reset for truncation message as well
setTruncatedDependentAxisWarning('');
}, [updateVizConfig, categoricalMode]);
}, [updateVizConfig, setTruncatedDependentAxisWarning]);

// set useEffect for changing truncation warning message
useEffect(() => {
Expand Down
5 changes: 3 additions & 2 deletions packages/libs/eda/src/lib/core/hooks/cachedPromise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ export function useCachedPromise<T>(

// Mapping the state from useQuery to PromiseHookState<T>
// and return something stable
const isPending = isLoading || isFetching;
const state: PromiseHookState<T> = useMemo(
() => ({
value: enabled ? data : undefined,
pending: enabled && (isLoading || isFetching),
pending: enabled && isPending,
error: error,
}),
[data, enabled, isLoading || isFetching, error]
[data, enabled, isPending, error]
);

return state;
Expand Down

0 comments on commit c29fde8

Please sign in to comment.