Support auth-protected images

This commit is contained in:
Jon Staab
2025-04-28 15:46:48 -07:00
parent ccdd18a863
commit b5a28c71ad
6 changed files with 62 additions and 8 deletions
+3 -2
View File
@@ -4,9 +4,10 @@
import {preventDefault, stopPropagation} from "@lib/html"
import Link from "@lib/components/Link.svelte"
import ContentLinkDetail from "@app/components/ContentLinkDetail.svelte"
import ContentLinkBlockImage from "@app/components/ContentLinkBlockImage.svelte"
import {pushModal} from "@app/modal"
const {value} = $props()
const {value, event} = $props()
let hideImage = $state(false)
@@ -37,7 +38,7 @@
</video>
{:else if url.match(/\.(jpe?g|png|gif|webp)$/)}
<button type="button" onclick={stopPropagation(preventDefault(expand))}>
<img alt="Link preview" src={imgproxy(url)} class="m-auto max-h-96 rounded-box" />
<ContentLinkBlockImage {event} {value} />
</button>
{:else}
{#await loadPreview()}