forked from Mirrors/elk
improve
This commit is contained in:
parent
cab3ed4ad4
commit
4e81d0e27d
1 changed files with 11 additions and 7 deletions
|
@ -15,6 +15,9 @@ const description = $computed(() => props.card.description ? props.card.descript
|
||||||
|
|
||||||
// TODO: handle card.type: 'photo' | 'video' | 'rich';
|
// 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', {
|
$fetch<string>('/api/og-image', {
|
||||||
params: { cardUrl: props.card.url },
|
params: { cardUrl: props.card.url },
|
||||||
}).then((ogImageUrl) => {
|
}).then((ogImageUrl) => {
|
||||||
|
@ -22,6 +25,7 @@ $fetch<string>('/api/og-image', {
|
||||||
if (ogImageUrl)
|
if (ogImageUrl)
|
||||||
image.value = ogImageUrl
|
image.value = ogImageUrl
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
Loading…
Reference in a new issue