fix: get attachment src url
parent
0ba7002d62
commit
22b4c4aaa5
|
@ -6,6 +6,8 @@ const { attachment } = defineProps<{
|
||||||
attachment: Attachment
|
attachment: Attachment
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
const src = $computed(() => attachment.remoteUrl || attachment.url || attachment.previewUrl!)
|
||||||
|
|
||||||
const rawAspectRatio = computed(() => {
|
const rawAspectRatio = computed(() => {
|
||||||
if (attachment.meta?.original?.aspect)
|
if (attachment.meta?.original?.aspect)
|
||||||
return attachment.meta.original.aspect
|
return attachment.meta.original.aspect
|
||||||
|
@ -60,14 +62,14 @@ const aspectRatio = computed(() => {
|
||||||
focus:ring="2 primary inset"
|
focus:ring="2 primary inset"
|
||||||
rounded-lg
|
rounded-lg
|
||||||
@click="openImagePreviewDialog({
|
@click="openImagePreviewDialog({
|
||||||
src: attachment.url || attachment.previewUrl!,
|
src,
|
||||||
alt: attachment.description!,
|
alt: attachment.description!,
|
||||||
})"
|
})"
|
||||||
>
|
>
|
||||||
<CommonBlurhash
|
<CommonBlurhash
|
||||||
:blurhash="attachment.blurhash"
|
:blurhash="attachment.blurhash"
|
||||||
class="status-attachment-image"
|
class="status-attachment-image"
|
||||||
:src="attachment.url || attachment.previewUrl!"
|
:src="src"
|
||||||
:alt="attachment.description!"
|
:alt="attachment.description!"
|
||||||
:style="{
|
:style="{
|
||||||
aspectRatio,
|
aspectRatio,
|
||||||
|
|
Loading…
Reference in New Issue