geido commented on code in PR #33789:
URL: https://github.com/apache/superset/pull/33789#discussion_r2166533618


##########
superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.tsx:
##########
@@ -125,7 +132,11 @@ export function getLayer(
       number,
       number,
     ]) || [0, 0, 0, 0];
-    if (selected.length > 0 && !selected.includes(d[fd.line_column])) {
+    if (
+      selected &&
+      selected.length > 0 &&
+      !selected.includes(d[fd.line_column])

Review Comment:
   Can we shorten this up too? 
   
   `!ensureIsArray(selected).includes(d[fd.line_column])`



##########
superset-frontend/plugins/legacy-preset-chart-deckgl/src/DeckGLContainer.tsx:
##########
@@ -58,6 +60,19 @@ export const DeckGLContainer = memo(
     const [lastUpdate, setLastUpdate] = useState<number | null>(null);
     const [viewState, setViewState] = useState(props.viewport);
     const prevViewport = usePrevious(props.viewport);
+    const glContextRef = useRef<WebGL2RenderingContext | null>(null);
+
+    useEffect(
+      () => () => {
+        if (glContextRef.current) {

Review Comment:
   Maybe we can shorten this up a bit without the if statements
   
   `glContextRef.current?.getExtension('WEBGL_lose_context')?.loseContext();`



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