gabotorresruiz commented on code in PR #37139:
URL: https://github.com/apache/superset/pull/37139#discussion_r2699400822


##########
superset-frontend/src/dashboard/components/nativeFilters/state.ts:
##########
@@ -222,11 +225,15 @@ export function useIsFilterInScope() {
         return isChartInScope || isCustomizationInActiveTab;
       }
 
-      const isFilterInActiveTab = filter.scope?.rootPath?.some(tab =>
-        activeTabs.includes(tab),
-      );
+      if (hasChartsInScope) {
+        return isChartInScope;
+      }
+
+      const isFilterInActiveTab =

Review Comment:
   Nit: `isFilterInActiveTab` could be `undefined` here if `rootPath` doesn't 
exist. Works fine since JS coerces it, but could be more explicit:
   
   ```js
   return !!isFilterInActiveTab;
   ```
   
   Or even simpler:
   ```js
   return filter.scope?.rootPath?.some(tab => activeTabs.includes(tab)) ?? 
false;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to