You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/01/27 01:32:45 UTC

[GitHub] [superset] eschutho commented on a change in pull request #18131: refactor(reports): refactoring reports

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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org