This commit is contained in:
Shinigami92 2022-12-10 23:27:06 +01:00
parent cab3ed4ad4
commit 4e81d0e27d

View file

@ -15,6 +15,9 @@ const description = $computed(() => props.card.description ? props.card.descript
// TODO: handle card.type: 'photo' | 'video' | 'rich';
// Only try to fetch og:image if the card.image is already provided from mastodon
// We only want to improve the image quality
if (image.value) {
$fetch<string>('/api/og-image', {
params: { cardUrl: props.card.url },
}).then((ogImageUrl) => {
@ -22,6 +25,7 @@ $fetch<string>('/api/og-image', {
if (ogImageUrl)
image.value = ogImageUrl
}).catch(() => {})
}
</script>
<template>