kgabryje commented on code in PR #20448:
URL: https://github.com/apache/superset/pull/20448#discussion_r903732619
##########
superset-frontend/src/explore/exploreUtils/index.js:
##########
@@ -38,8 +38,8 @@ import { DashboardStandaloneMode } from
'src/dashboard/util/constants';
import { optionLabel } from '../../utils/common';
export function getChartKey(explore) {
- const { slice } = explore;
- return slice ? slice.slice_id : 0;
+ const { slice, form_data } = explore;
+ return slice?.slice_id ?? form_data?.slice_id ?? 0;
}
Review Comment:
+1 for creating a constant for default slice id, but is there a use case for
splitting this function in 2?
--
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]