mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2026-05-09 07:25:01 -04:00
fix: format code for better readability in LocationQuickStart component
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user