forked from MapComplete/MapComplete
Feature: add emergency image backup. If uploading images fails, they are saved into local storage and uploaded later on. Part of #2111, but also #2342
This commit is contained in:
parent
7380841205
commit
9f3d198068
9 changed files with 313 additions and 8 deletions
|
|
@ -61,6 +61,9 @@
|
|||
import Hotkeys from "../Base/Hotkeys"
|
||||
import { ArrowTrendingUp } from "@babeard/svelte-heroicons/solid/ArrowTrendingUp"
|
||||
import ArrowTopRightOnSquare from "@babeard/svelte-heroicons/mini/ArrowTopRightOnSquare"
|
||||
import FailedImagesView from "../Image/FailedImagesView.svelte"
|
||||
import { PhotoIcon } from "@babeard/svelte-heroicons/outline"
|
||||
import EmergencyImageBackup from "../../Logic/ImageProviders/EmergencyImageBackup"
|
||||
|
||||
export let state: {
|
||||
favourites: FavouritesFeatureSource
|
||||
|
|
@ -97,6 +100,8 @@
|
|||
}
|
||||
})
|
||||
let isAndroid = AndroidPolyfill.inAndroid
|
||||
let nrOfFailedImages = EmergencyImageBackup.singleton.failedImages
|
||||
let failedImagesOpen = pg.failedImages
|
||||
</script>
|
||||
|
||||
<div
|
||||
|
|
@ -156,6 +161,16 @@
|
|||
/>
|
||||
</Page>
|
||||
|
||||
{#if $nrOfFailedImages.length > 0 || $failedImagesOpen}
|
||||
<Page {onlyLink} shown={pg.failedImages} bodyPadding="p-0 pb-4">
|
||||
<svelte:fragment slot="header">
|
||||
<PhotoIcon />
|
||||
<Tr t={Translations.t.failedImages.menu.Subs({count: $nrOfFailedImages.length})} />
|
||||
</svelte:fragment>
|
||||
<FailedImagesView {state} />
|
||||
</Page>
|
||||
{/if}
|
||||
|
||||
<LoginToggle {state} silentFail>
|
||||
{#if state.favourites}
|
||||
<Page {onlyLink} shown={pg.favourites}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue