fix: format code for better readability in LocationQuickStart component

This commit is contained in:
Sean Morley
2026-04-04 22:26:39 -04:00
parent f1548d1fb0
commit 8a574cf675

View File

@@ -107,7 +107,9 @@
const dLng = item.lng - lng;
const distanceScore = dLat * dLat + dLng * dLng;
const nameScore =
normalizedPreferredName && item.name?.trim().toLowerCase() === normalizedPreferredName ? -1 : 0;
normalizedPreferredName && item.name?.trim().toLowerCase() === normalizedPreferredName
? -1
: 0;
const placeScore = item.place_id ? -0.5 : 0;
return {
item,
@@ -138,9 +140,7 @@
}
const rawResults = await response.json();
const mappedResults = Array.isArray(rawResults)
? rawResults.map(toPlaceResult)
: [];
const mappedResults = Array.isArray(rawResults) ? rawResults.map(toPlaceResult) : [];
const bestMatch = pickBestNearbyResult(mappedResults, lat, lng, query);
if (!bestMatch || !selectedLocation) {
return;
@@ -362,7 +362,9 @@
...selectedLocation,
name:
resolvedLocationName ||
(isCoordinatePlaceholder && resolvedDisplayName ? resolvedDisplayName : selectedLocation.name),
(isCoordinatePlaceholder && resolvedDisplayName
? resolvedDisplayName
: selectedLocation.name),
location: resolvedDisplayName || `${lat.toFixed(4)}, ${lng.toFixed(4)}`
};
searchQuery = selectedLocation.name;