web/PickerItem: enable video thumb mode only when item is a video

This commit is contained in:
wukko 2024-07-23 22:11:25 +06:00
parent 5e26c1e122
commit 6e24a8d172
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -17,10 +17,7 @@
$: itemType = item.type ?? "photo"; $: itemType = item.type ?? "photo";
</script> </script>
<button <button class="picker-item" on:click={() => downloadFile(item.url)}>
class="picker-item"
on:click={() => downloadFile(item.url)}
>
<div class="picker-type"> <div class="picker-type">
{#if itemType === "video"} {#if itemType === "video"}
<IconMovie /> <IconMovie />
@ -34,7 +31,7 @@
src={item.thumb ?? item.url} src={item.thumb ?? item.url}
class:loading={!imageLoaded} class:loading={!imageLoaded}
class:video-thumbnail={item.thumb} class:video-thumbnail={itemType === "video"}
on:load={() => imageLoaded = true} on:load={() => imageLoaded = true}
alt="{$t(`a11y.dialog.picker.item.${itemType}`)} {number}" alt="{$t(`a11y.dialog.picker.item.${itemType}`)} {number}"