Outages review fixes: reset on new target, memoize marker icons, coverage note in popup (#184)

- useOutagesIn kept the previous incident's answer while fetching the next
  one (IncidentPanel isn't keyed), so a newly selected incident briefly read
  'none reported here'. Drop the old answer when the target changes.
- OutageLayer built a fresh divIcon per marker every render; MapView
  re-renders on live updates, so Leaflet rebuilt every marker's DOM. Memoize.
- Popup now carries the provider's coverage note (ODIN: non-reporting
  utilities, e.g. Con Ed/O&R, show nothing even during an outage).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Logan Cusano
2026-10-05 03:16:58 -04:00
co-authored by Claude Opus 5.5
parent d10c2f732a
commit e7070a0afa
2 changed files with 10 additions and 3 deletions
+4 -1
View File
@@ -34,7 +34,10 @@ function useOutageFetch(
const seq = useRef(0);
useEffect(() => {
if (!getBox) { setData(null); setError(null); setLoaded(false); return; }
// A new target (another incident, overlay re-enabled) must not be judged
// against the previous target's answer: drop it and show "checking…".
setData(null); setError(null); setLoaded(false);
if (!getBox) return;
const boxFn = getBox;
let last = 0;
const load = async () => {