MapComplete/src/UI/BigComponents/ClearGPSHistory.svelte

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
612 B
Svelte
Raw Normal View History

2025-02-12 16:51:37 +01:00
<script lang="ts">
import Trash from "@babeard/svelte-heroicons/mini/Trash"
import { WithSelectedElementState } from "../../Models/ThemeViewState/WithSelectedElementState"
import Translations from "../i18n/Translations"
import Tr from "../Base/Tr.svelte"
export let state: WithSelectedElementState
function clear() {
console.log("Clearing history")
state.historicalUserLocations.features.setData([])
state.selectedElement.setData(undefined)
}
</script>
<button on:click={() => clear()}>
2025-03-06 16:21:55 +01:00
<Trash class="h-6 w-6" />
2025-02-12 16:51:37 +01:00
<Tr t={Translations.t.general.removeLocationHistory} />
</button>