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[]) => {
167
167
} ;
168
168
169
169
/**
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
+ */
173
173
const decideMediaAtomImage = (
174
174
videoReplace : boolean ,
175
175
mediaAtom : FEMediaAtom ,
176
176
cardTrailImage ?: string ,
177
177
) => {
178
+ const largestMediaAtomImage = getLargestImageUrl (
179
+ mediaAtom . trailImage ?. allImages ,
180
+ ) ;
181
+
178
182
if ( videoReplace ) {
179
- return getLargestImageUrl ( mediaAtom . trailImage ?. allImages ) ;
183
+ return largestMediaAtomImage ?? cardTrailImage ;
180
184
}
181
- return (
182
- cardTrailImage ?? getLargestImageUrl ( mediaAtom . trailImage ?. allImages )
183
- ) ;
185
+
186
+ return cardTrailImage ?? largestMediaAtomImage ;
184
187
} ;
185
188
186
189
/**
You can’t perform that action at this time.
0 commit comments