rusackas commented on code in PR #37107:
URL: https://github.com/apache/superset/pull/37107#discussion_r2728914678


##########
superset-frontend/src/components/Chart/ChartRenderer.tsx:
##########
@@ -123,8 +236,12 @@ class ChartRenderer extends Component {
       onFilterMenuOpen: this.props.onFilterMenuOpen,
       onFilterMenuClose: this.props.onFilterMenuClose,
       onLegendStateChanged: this.handleLegendStateChanged,
-      setDataMask: dataMask => {
-        this.props.actions?.updateDataMask(this.props.chartId, dataMask);
+      setDataMask: (dataMask: DataMask) => {
+        if (this.props.actions?.updateDataMask) {
+          this.props.actions.updateDataMask(this.props.chartId, dataMask);
+        } else {
+          this.props.setDataMask?.(dataMask);

Review Comment:
   You're right\! Fixed. The else branch was accidentally added and changed the 
behavior. Now it uses double optional chaining (`actions?.updateDataMask?.`) to 
match the original JavaScript behavior while satisfying TypeScript.



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