Prevent error loop on images
This commit is contained in:
parent
b114a724e2
commit
a4e883b09a
1 changed files with 3 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {onMount, onDestroy} from "svelte"
|
import {onMount, onDestroy} from "svelte"
|
||||||
import {displayUrl} from "@welshman/lib"
|
import {displayUrl, once} from "@welshman/lib"
|
||||||
import {
|
import {
|
||||||
getTags,
|
getTags,
|
||||||
getBlob,
|
getBlob,
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
const nonce = getTagValue("decryption-nonce", meta)
|
const nonce = getTagValue("decryption-nonce", meta)
|
||||||
const algorithm = getTagValue("encryption-algorithm", meta)
|
const algorithm = getTagValue("encryption-algorithm", meta)
|
||||||
|
|
||||||
const onError = async () => {
|
const onError = once(async () => {
|
||||||
// If the image failed to load, try authenticating
|
// If the image failed to load, try authenticating
|
||||||
if (hash && $signer) {
|
if (hash && $signer) {
|
||||||
const server = new URL(url).origin
|
const server = new URL(url).origin
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
} else {
|
} else {
|
||||||
hasError = true
|
hasError = true
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
|
|
||||||
let hasError = $state(false)
|
let hasError = $state(false)
|
||||||
let src = $state("")
|
let src = $state("")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue