Skip to content

Commit

Permalink
gather more info about best rendition error, there should always be a…
Browse files Browse the repository at this point in the history
… rendition
  • Loading branch information
giannif committed Oct 31, 2024
1 parent 76189d4 commit 209f5ba
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/react-components/src/components/gif.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,14 @@ const Gif = ({
percentHeight = `${ratio}%`
}
const bestRendition = getBestRendition(gif.images, width, height)
if (!bestRendition) {
if (gif.images) {
console.error(`no rendition for ${gif.id}, rendition names: ${Object.keys(gif.images)}`)
} else {
console.error(`no rendition for ${gif.id} - no images`)
}
return null
}
const rendition = gif.images[bestRendition.renditionName] as ImageAllTypes
const background =
backgroundColor || // <- specified background prop
Expand Down

0 comments on commit 209f5ba

Please sign in to comment.