feat(web): add QueryErrorBoundary and use real map coordinates
Add global QueryErrorResetBoundary wrapping the app so TanStack Query errors are caught with a retry UI instead of crashing. Enable throwOnError in QueryClient defaults. Update ListingMap to use real latitude/longitude from API when available, falling back to city-based jitter for listings without coordinates. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -38,6 +38,9 @@ const DEFAULT_CENTER: [number, number] = [106.6297, 10.8231]; // HCMC [lng, lat]
|
||||
const DEFAULT_ZOOM = 12;
|
||||
|
||||
function getMarkerCoords(listing: ListingDetail, index: number): { lat: number; lng: number } {
|
||||
if (listing.property.latitude != null && listing.property.longitude != null) {
|
||||
return { lat: listing.property.latitude, lng: listing.property.longitude };
|
||||
}
|
||||
const base = CITY_COORDS[listing.property.city] || [10.8231, 106.6297];
|
||||
const seed = listing.id.charCodeAt(0) + index;
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user