Skip to content

Commit

Permalink
Refetch samples only when filters change (#11999)
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje authored Jan 2, 2021
1 parent f3ab1f4 commit 7cc0de1
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions superset-frontend/src/explore/components/DataTablesPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,19 @@ export const DataTablesPane = ({
);

useEffect(() => {
setIsRequestPending({
setIsRequestPending(prevState => ({
...prevState,
[RESULT_TYPES.results]: true,
[RESULT_TYPES.samples]: true,
});
}));
}, [queryFormData]);

useEffect(() => {
setIsRequestPending(prevState => ({
...prevState,
[RESULT_TYPES.samples]: true,
}));
}, [queryFormData.adhoc_filters]);

useEffect(() => {
if (panelOpen && isRequestPending[RESULT_TYPES.results]) {
setIsRequestPending(prevState => ({
Expand Down

0 comments on commit 7cc0de1

Please sign in to comment.