fix: insights crash, dup grids, .map() guards
Add /api/insights/cards endpoint with proper card format matching frontend expectations. Fixes "Cannot read properties of undefined (reading 'map')" crash. Switch frontend to use new endpoint. Replace alert marker rectangles with circleMarkers so they don't look like a second grid. Default showAlertMarkers to false. Add || [] guards on data.features.map() and alerts.map(). Reduce RiskMap grid count 3000→1500, debounce 150ms→300ms.
This commit is contained in:
@@ -191,7 +191,7 @@ export const useMonitoringStore = create<MonitoringState>((set) => ({
|
||||
try {
|
||||
const data = await gridApi.getGridsGeoJSON(date);
|
||||
|
||||
const features: GridFeature[] = data.features.map((f: any) => ({
|
||||
const features: GridFeature[] = (data.features || []).map((f: any) => ({
|
||||
grid_id: f.properties.grid_id,
|
||||
latitude: f.properties.latitude,
|
||||
longitude: f.properties.longitude,
|
||||
|
||||
Reference in New Issue
Block a user