Skip to content

Commit 3178675

Browse files
fix typecheck errors
1 parent df48597 commit 3178675

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

web/src/features/map/map-layers/GridAlertsLayer.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ export default function GridAlertsLayer() {
4040
return null;
4141
}
4242

43+
// fallback logic
44+
if (!dataState_ || !dataState_.alerts) {
45+
return null;
46+
}
47+
4348
// Create one point per unique zoneId that needs a warning
4449
const warningZones = dataState_.alerts; // Add more zone IDs as needed for example ['CA-ON', 'US-MIDA-PJM']
4550
const features = [];
@@ -84,7 +89,7 @@ export default function GridAlertsLayer() {
8489
type: 'FeatureCollection',
8590
features,
8691
};
87-
}, [worldGeometries]);
92+
}, [worldGeometries, dataState_]);
8893

8994
return (
9095
<>

web/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export type ZoneKey = string;
1414

1515
export interface GridState {
1616
_disclaimer: string;
17+
alerts?: string[];
1718
createdAt: string;
1819
datetimes: {
1920
/** Object representing the grid state at a single point in time */

0 commit comments

Comments
 (0)