@@ -68,13 +68,8 @@ export default function renderGeneral(this: CollectionEdit) {
68
68
mode ="thumbnail "
69
69
.collection =${ this . collection }
70
70
.collectionId =${ this . collection . id }
71
- .initialSelectedSnapshot=${ this . selectedSnapshot
72
- ? {
73
- pageId : this . selectedSnapshot . urlPageId ,
74
- ts : this . selectedSnapshot . urlTs ,
75
- status : 200 ,
76
- }
77
- : undefined }
71
+ .selectedSnapshot=${ sourceToSnapshot ( this . selectedSnapshot ) ??
72
+ undefined }
78
73
@btrix-select=${ async ( e : CustomEvent < SelectSnapshotDetail > ) => {
79
74
if ( ! e . detail . item ) return ;
80
75
await this . updateComplete ;
@@ -221,7 +216,11 @@ function renderThumbnails(this: CollectionEdit) {
221
216
< div class ="row-start-1 text-xs text-neutral-500 ">
222
217
${ msg ( "Page Thumbnail" ) }
223
218
</ div >
224
- ${ renderPageThumbnail . bind ( this ) ( this . collection ?. thumbnail ?. path ) }
219
+ ${ renderPageThumbnail . bind ( this ) (
220
+ this . defaultThumbnailName == null
221
+ ? this . collection ?. thumbnail ?. path
222
+ : null ,
223
+ ) }
225
224
< div class ="sticky left-0 row-start-1 text-xs text-neutral-600 ">
226
225
${ msg ( "Placeholder" ) }
227
226
</ div >
@@ -257,9 +256,6 @@ function renderPageThumbnail(
257
256
this . blobIsLoaded = false ;
258
257
} ) ;
259
258
260
- const enabled =
261
- ( ! ! this . selectedSnapshot && this . blobIsLoaded ) || ! ! initialPath ;
262
-
263
259
console . log ( {
264
260
selectedSnapshot : this . selectedSnapshot ,
265
261
blobIsLoaded : ! ! this . blobIsLoaded ,
@@ -270,15 +266,13 @@ function renderPageThumbnail(
270
266
< button
271
267
class =${ clsx (
272
268
isSelected ? tw `ring-2 ring-blue-300 ` : tw ` ring-1 ring-stone-600 /10` ,
273
- tw `row-start-2 aspect-video min-w-48 overflow-hidden rounded transition-all` ,
274
- enabled && tw `hover:ring-2 hover:ring-blue-300` ,
269
+ tw `row-start-2 aspect-video min-w-48 overflow-hidden rounded transition-all hover:ring-2 hover:ring-blue-300` ,
275
270
) }
276
- ?disabled=${ ! enabled }
277
271
role="radio "
278
272
type ="button "
279
273
aria-checked =${ isSelected }
280
274
@click =${ ( ) => {
281
- if ( ! enabled ) return ;
275
+ this . thumbnailSelector ?. input ?. focus ( ) ;
282
276
this . defaultThumbnailName = null ;
283
277
void this . checkChanged . bind ( this ) ( ) ;
284
278
} }
@@ -302,7 +296,7 @@ function renderPageThumbnail(
302
296
replaySrc=${ `/replay/?${ query } #view=pages` }
303
297
.snapshot=${ sourceToSnapshot ( this . selectedSnapshot ) }
304
298
?noSpinner=${ ! ! initialPath &&
305
- isEqual ( this . selectedSnapshot , this . collection ?. thumbnailSource ) }
299
+ ! isEqual ( this . selectedSnapshot , this . collection ?. thumbnailSource ) }
306
300
@btrix-validate=${ ( {
307
301
detail : { valid } ,
308
302
} : CustomEvent < BtrixValidateDetails > ) => {
0 commit comments