eschutho commented on a change in pull request #18131:
URL: https://github.com/apache/superset/pull/18131#discussion_r793185553



##########
File path: 
superset-frontend/src/components/ReportModal/HeaderReportActionsDropdown/index.tsx
##########
@@ -46,21 +47,16 @@ export default function HeaderReportActionsDropDown({
   chart?: ChartState;
 }) {
   const dispatch = useDispatch();
-  const report: AlertObject = useSelector<any, AlertObject>(state => {
+
+  const findReport = useSelector<any, AlertObject>(state => {
     if (dashboardId) {
       return state.reports.dashboards?.[dashboardId];
     }
     if (chart?.id) {
-      return state.reports.charts?.[chart.id];
+      return state.reports.charts?.[chart?.id];

Review comment:
       I don't think you need the optional chaining here, since you check for 
`chart` on line 55.




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