feat: add remote url to image srcset in case original is down

This commit is contained in:
Daniel Roe 2022-12-04 12:48:07 +00:00
parent 7760d03f9d
commit 8537c8ee54
No known key found for this signature in database
GPG key ID: 22D5008E4F5D9B55

View file

@ -10,6 +10,7 @@ const { attachment } = defineProps<{
const src = $computed(() => attachment.previewUrl || attachment.url || attachment.remoteUrl!)
const srcset = $computed(() => [
[attachment.url, attachment.meta?.original?.width],
[attachment.remoteUrl, attachment.meta?.original?.width],
[attachment.previewUrl, attachment.meta?.small?.width],
].filter(([url]) => url).map(([url, size]) => `${url} ${size}w`).join(', '))