File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
dotcom-rendering/src/model Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -167,20 +167,23 @@ const getLargestImageUrl = (images?: Image[]) => {
167167} ;
168168
169169/**
170- * If we have a replacement video, we should use the largest available trail image from the media atom.
171- * For all other videos, we should use the card's trail image where it is available and fall back to the media trail image.
172- * * /
170+ * If we have a replacement video, we should prioritise the largest available trail image from the media atom.
171+ * For all other videos, we should prioritise the card's trail image.
172+ */
173173const decideMediaAtomImage = (
174174 videoReplace : boolean ,
175175 mediaAtom : FEMediaAtom ,
176176 cardTrailImage ?: string ,
177177) => {
178+ const largestMediaAtomImage = getLargestImageUrl (
179+ mediaAtom . trailImage ?. allImages ,
180+ ) ;
181+
178182 if ( videoReplace ) {
179- return getLargestImageUrl ( mediaAtom . trailImage ?. allImages ) ;
183+ return largestMediaAtomImage ?? cardTrailImage ;
180184 }
181- return (
182- cardTrailImage ?? getLargestImageUrl ( mediaAtom . trailImage ?. allImages )
183- ) ;
185+
186+ return cardTrailImage ?? largestMediaAtomImage ;
184187} ;
185188
186189/**
You can’t perform that action at this time.
0 commit comments