fix: Use default collection thumbnail if selected (#2331)

Fixes issue where collection thumbnail is always the screenshot, even if
a Browsertrix provided default thumbnail is selected after choosing the
screenshot.
This commit is contained in:
sua yoo 2025-01-22 14:02:56 -08:00 committed by GitHub
parent 28d39d8c4d
commit f8976e688a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -71,10 +71,9 @@ export class CollectionsGrid extends BtrixElement {
>
<btrix-collection-thumbnail
src=${ifDefined(
collection.thumbnail?.path ||
Object.entries(CollectionThumbnail.Variants).find(
([name]) => name === collection.defaultThumbnailName,
)?.[1].path,
Object.entries(CollectionThumbnail.Variants).find(
([name]) => name === collection.defaultThumbnailName,
)?.[1].path || collection.thumbnail?.path,
)}
></btrix-collection-thumbnail>
${this.renderDateBadge(collection)}