From aea9aeec2132ac334861aea53ceb848175f7eb47 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sat, 3 Feb 2024 14:48:32 +0100 Subject: [PATCH] UX: searching will unlock the GPS and cancel 'move to gps' if still waiting for a fix --- src/UI/BigComponents/Geosearch.svelte | 4 ++++ src/UI/BigComponents/ThemeIntroPanel.svelte | 1 + src/UI/ThemeViewGUI.svelte | 2 ++ 3 files changed, 7 insertions(+) diff --git a/src/UI/BigComponents/Geosearch.svelte b/src/UI/BigComponents/Geosearch.svelte index 2aeca7eda..4934f81b4 100644 --- a/src/UI/BigComponents/Geosearch.svelte +++ b/src/UI/BigComponents/Geosearch.svelte @@ -11,11 +11,13 @@ import { placeholder } from "../../Utils/placeholder" import { SearchIcon } from "@rgossiaux/svelte-heroicons/solid" import { ariaLabel } from "../../Utils/ariaLabel" + import { GeoLocationState } from "../../Logic/State/GeoLocationState" export let perLayer: ReadonlyMap | undefined = undefined export let bounds: UIEventSource export let selectedElement: UIEventSource | undefined = undefined + export let geolocationState: GeoLocationState | undefined = undefined export let clearAfterView: boolean = true let searchContents: string = "" export let triggerSearch: UIEventSource = new UIEventSource(undefined) @@ -55,6 +57,8 @@ async function performSearch() { try { isRunning = true + geolocationState?.allowMoving.setData(true) + geolocationState?.requestMoment.setData(undefined) // If the GPS is still searching for a fix, we say that we don't want tozoom to it anymore searchContents = searchContents?.trim() ?? "" if (searchContents === "") { diff --git a/src/UI/BigComponents/ThemeIntroPanel.svelte b/src/UI/BigComponents/ThemeIntroPanel.svelte index f706f01e5..922153eb7 100644 --- a/src/UI/BigComponents/ThemeIntroPanel.svelte +++ b/src/UI/BigComponents/ThemeIntroPanel.svelte @@ -113,6 +113,7 @@ perLayer={state.perLayer} {selectedElement} {triggerSearch} + geolocationState={state.geolocation.geolocationState} />