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


##########
superset-frontend/src/dashboard/actions/chartCustomizationActions.ts:
##########
@@ -203,10 +204,20 @@ export function saveChartCustomization(
         dispatch(onSave(lastModifiedTime));
       }
 
-      const { dashboardState } = getState();
-      const chartIds = dashboardState.sliceIds || [];
-      if (chartIds.length > 0) {
-        chartIds.forEach(chartId => {
+      const sliceEntities = getState().sliceEntities || {};
+      const slices = sliceEntities.slices || {};
+      const affectedChartIds: number[] = [];
+      simpleItems.forEach(customization => {
+        const relatedCharts = getRelatedChartsForChartCustomization(
+          customization,
+          slices,
+        );
+        affectedChartIds.push(...relatedCharts);
+      });
+
+      const uniqueAffectedChartIds = [...new Set(affectedChartIds)];
+      if (uniqueAffectedChartIds.length > 0) {
+        uniqueAffectedChartIds.forEach(chartId => {

Review Comment:
   LGTM!
   
   Just a small nit:
   It seems like we're doing the same here and then in 
`superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx`.
   
   Maybe we can create a custom hook or a util function that we can reuse in 
both places



-- 
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