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:
Ho Ngoc Hai
2026-04-10 17:58:35 +07:00
parent e03c4699d0
commit ab478a565a
4 changed files with 77 additions and 2 deletions

View File

@@ -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 {