From 40d0d715c99d41ea142bacb6dc1982ecfc620d0b Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Mon, 24 May 2021 02:16:33 +0800 Subject: [PATCH] fix: extra query in Dashboard when native filter enabled --- .../dashboard/components/nativeFilters/FilterBar/index.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx index 534866b57d343..3d6f7eb161ae4 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx @@ -187,8 +187,11 @@ const FilterBar: React.FC = ({ setIsFilterSetChanged(tab !== TabIds.AllFilters); setDataMaskSelected(draft => { const children = cascadeChildren[filter.id] || []; - // force instant updating on initialization or for parent filters - if (filter.isInstant || children.length > 0) { + // force instant updating on initialization or for parent filters when dataMaskSelected has filter + if ( + dataMaskSelected[filter.id] && + (filter.isInstant || children.length > 0) + ) { dispatch(updateDataMask(filter.id, dataMask)); }