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


##########
superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx:
##########
@@ -168,55 +184,74 @@ const Chart = props => {
     [dispatch],
   );
 
-  const chart = useSelector(state => state.charts[props.id] || EMPTY_OBJECT);
-  const { queriesResponse, chartUpdateEndTime, chartStatus, annotationQuery } =
-    chart;
+  const chart = useSelector((state: RootState) => state.charts[props.id]);
+  const queriesResponse = chart?.queriesResponse;
+  const chartUpdateEndTime = chart?.chartUpdateEndTime;
+  const chartStatus = chart?.chartStatus;
+  const annotationQuery = chart?.annotationQuery;
 
-  const slice = useSelector(
-    state => state.sliceEntities.slices[props.id] || EMPTY_OBJECT,
+  const slice: SliceEntity | Record<string, never> = useSelector(
+    (state: RootState) =>
+      (state.sliceEntities as { slices: Record<number, SliceEntity> }).slices[
+        props.id
+      ] || EMPTY_OBJECT,
+  );
+  const sliceVizType = (slice as SliceEntity)?.viz_type;
+  const sliceSliceId = (slice as SliceEntity)?.slice_id;
+  const sliceSliceName = (slice as SliceEntity)?.slice_name;
+  const editMode = useSelector(
+    (state: RootState) => state.dashboardState.editMode,

Review Comment:
   Actually... attempting to tackle this...



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