forked from MapComplete/MapComplete
chore: automated housekeeping...
This commit is contained in:
parent
94c61744c0
commit
04c8ccb0d2
89 changed files with 2353 additions and 1390 deletions
|
@ -50,26 +50,21 @@
|
|||
|
||||
async function detectErrorReason() {
|
||||
try {
|
||||
|
||||
const response = await fetch(
|
||||
image.url,
|
||||
{
|
||||
headers: {
|
||||
"Accept": "image/avif,image/webp,*/*",
|
||||
},
|
||||
const response = await fetch(image.url, {
|
||||
headers: {
|
||||
Accept: "image/avif,image/webp,*/*",
|
||||
},
|
||||
)
|
||||
})
|
||||
if (response.status === 404) {
|
||||
notFound = true
|
||||
}
|
||||
} catch
|
||||
(e) {
|
||||
} catch (e) {
|
||||
console.log("Could not load image while trying to remediate", e)
|
||||
}
|
||||
}
|
||||
|
||||
async function onError() {
|
||||
Mapillary.isInStrictMode().addCallbackAndRunD(isStrict => {
|
||||
Mapillary.isInStrictMode().addCallbackAndRunD((isStrict) => {
|
||||
isInStrictMode.set(isStrict)
|
||||
return true // unregister
|
||||
})
|
||||
|
@ -82,16 +77,16 @@
|
|||
onDestroy(
|
||||
showBigPreview.addCallbackAndRun((shown) => {
|
||||
state?.guistate?.setPreviewedImage(shown ? image : undefined)
|
||||
}),
|
||||
})
|
||||
)
|
||||
if (previewedImage) {
|
||||
onDestroy(
|
||||
previewedImage.addCallbackAndRun((previewedImage) => {
|
||||
showBigPreview.set(
|
||||
previewedImage !== undefined &&
|
||||
(previewedImage?.id ?? previewedImage?.url) === (image.id ?? image.url),
|
||||
(previewedImage?.id ?? previewedImage?.url) === (image.id ?? image.url)
|
||||
)
|
||||
}),
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -135,17 +130,17 @@
|
|||
</div>
|
||||
</Popup>
|
||||
{#if error}
|
||||
<div class="h-80 w-60 interactive flex flex-col justify-center items-center p-4 text-center">
|
||||
<div class="interactive flex h-80 w-60 flex-col items-center justify-center p-4 text-center">
|
||||
{#if notFound}
|
||||
<div class="alert flex items-center">
|
||||
<TriangleOutline class="shrink-0 h-8 w-8" />
|
||||
<TriangleOutline class="h-8 w-8 shrink-0" />
|
||||
Not found
|
||||
</div>
|
||||
This image is probably incorrect or deleted.
|
||||
<slot name="not-found-extra" />
|
||||
{:else}
|
||||
<div class="alert flex items-center">
|
||||
<TriangleOutline class="shrink-0 h-8 w-8" />
|
||||
<TriangleOutline class="h-8 w-8 shrink-0" />
|
||||
<Tr t={Translations.t.image.loadingFailed} />
|
||||
</div>
|
||||
{#if image.provider.name.toLowerCase() === "mapillary" && $isInStrictMode}
|
||||
|
@ -153,7 +148,7 @@
|
|||
{:else if $isInStrictMode}
|
||||
<Tr t={Translations.t.image.strictProtectionDetected} />
|
||||
{image.provider.name}
|
||||
<div class="subtle text-sm mt-8">{image.url}</div>
|
||||
<div class="subtle mt-8 text-sm">{image.url}</div>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
|
@ -225,10 +220,10 @@
|
|||
</div>
|
||||
</div>
|
||||
{:else if image.status === "hidden"}
|
||||
<div class="h-80 w-60 flex flex-col justify-center items-center break-words p-4 text-center">
|
||||
<TriangleOutline class="w-8 h-8 subtle" />
|
||||
<div class="flex h-80 w-60 flex-col items-center justify-center break-words p-4 text-center">
|
||||
<TriangleOutline class="subtle h-8 w-8" />
|
||||
<Tr t={Translations.t.image.reported} />
|
||||
<button class="text-sm" on:click={() => ignoreHidden = true}>
|
||||
<button class="text-sm" on:click={() => (ignoreHidden = true)}>
|
||||
<Tr t={Translations.t.image.showAnyway} />
|
||||
</button>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue