Skip to content

Commit 8a574cf

Browse files
committed
fix: format code for better readability in LocationQuickStart component
1 parent f1548d1 commit 8a574cf

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

frontend/src/lib/components/locations/LocationQuickStart.svelte

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@
107107
const dLng = item.lng - lng;
108108
const distanceScore = dLat * dLat + dLng * dLng;
109109
const nameScore =
110-
normalizedPreferredName && item.name?.trim().toLowerCase() === normalizedPreferredName ? -1 : 0;
110+
normalizedPreferredName && item.name?.trim().toLowerCase() === normalizedPreferredName
111+
? -1
112+
: 0;
111113
const placeScore = item.place_id ? -0.5 : 0;
112114
return {
113115
item,
@@ -138,9 +140,7 @@
138140
}
139141
140142
const rawResults = await response.json();
141-
const mappedResults = Array.isArray(rawResults)
142-
? rawResults.map(toPlaceResult)
143-
: [];
143+
const mappedResults = Array.isArray(rawResults) ? rawResults.map(toPlaceResult) : [];
144144
const bestMatch = pickBestNearbyResult(mappedResults, lat, lng, query);
145145
if (!bestMatch || !selectedLocation) {
146146
return;
@@ -362,7 +362,9 @@
362362
...selectedLocation,
363363
name:
364364
resolvedLocationName ||
365-
(isCoordinatePlaceholder && resolvedDisplayName ? resolvedDisplayName : selectedLocation.name),
365+
(isCoordinatePlaceholder && resolvedDisplayName
366+
? resolvedDisplayName
367+
: selectedLocation.name),
366368
location: resolvedDisplayName || `${lat.toFixed(4)}, ${lng.toFixed(4)}`
367369
};
368370
searchQuery = selectedLocation.name;

0 commit comments

Comments
 (0)