sadpandajoe commented on code in PR #45640:
URL: https://github.com/apache/superset/pull/45640#discussion_r4428946130


##########
superset-frontend/packages/superset-ui-core/src/components/ListViewCard/ImageLoader.tsx:
##########
@@ -57,7 +58,7 @@ export function ImageLoader({
 
   useEffect(() => {
     if (src) {
-      fetch(src)
+      SupersetClient.get({ endpoint: src, parseMethod: 'raw' })

Review Comment:
   `SupersetClient.get` calls `getInstance()`, which throws synchronously when 
`configure()` was never called, so the error skips the `.catch` below and the 
effect throws on mount instead of showing the fallback image. Storybook and the 
docs portal never configure the client, and 
`docs/developer_docs/components/ui/listviewcard.mdx` at this head still passes 
`imgURL="https://picsum.photos/seed/superset/300/200"` (lines 39 and 100), so 
that live example would crash rather than render. Could the request be started 
inside the promise chain (for example `Promise.resolve().then(() => 
SupersetClient.get(...))`) so an unconfigured client falls back to 
`imgFallbackURL`?



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