zero-to-mastery / breads-client

Keep track of what you read online and see what your friends are reading.
https://www.breads.io/
Other
46 stars 59 forks source link

Some images fail to load #87

Closed aubundy closed 3 years ago

aubundy commented 3 years ago
Screen Shot 2021-09-22 at 8 23 34 PM

Some images within an article card fail to load. When this happens, the alt text and a placeholder icon gets substituted for the original image. Whenever an image fails to load, we should prevent the alt text and placeholder from displaying. I'm not sure if we can prevent this, though. It may have something to do with weserv, an image caching service we use

mcflav commented 3 years ago

I would like to take a look a this and maybe provide a solution. Just let me know what I need to do. thanks!

aubundy commented 3 years ago

Thanks @mcflav! The code for this can be found in src/features/globalReadings/ListItem.tsx. I think the issue may have something to do with serveImageThroughCDN()

mcflav commented 3 years ago

Ok. I added an onError function to the image tag that holds the image from serveImageThroughCDN(). Please let me know if this code produces the desired results you are looking for. Thanks.

aubundy commented 3 years ago

Image alternate text

mcflav commented 3 years ago

I just submitted the pull request for the changes you requested. Please review at your earliest convenience. Thanks.

image