[wip] Enhance AddressPicker to auto-select position when a single address with one position is found.

This commit is contained in:
2025-08-22 23:09:38 +02:00
parent eb25f1408e
commit 8cade9ac77

View File

@@ -63,6 +63,11 @@ const performSearchForAddress = async (search: string): Promise<void> => {
abortControllerSearchAddress,
);
abortControllerSearchAddress = null;
// check if there is only one result
if (addresses.value.length === 1 && Object.keys(addresses.value[0].positions).length === 1) {
onPickPosition(Object.keys(addresses.value[0].positions)[0]);
}
} catch (e: unknown) {
if (e instanceof DOMException && e.name === "AbortError") {
console.log("search aborted for:", search);