mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-24 23:55:02 +00:00
[wip] Enhance AddressPicker to auto-select position when a single address with one position is found.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user