fix(cyclones): evict prior shared selection on storm switch

Regression: explicit storm A→B→A keeps one active record.
Reviewer finding: quanticsoul4772 (#847).
This commit is contained in:
Kevin Rajan committed 2026-10-16 23:01:44 -05:00
1 parent 28f3243090
commit a803be1af2
4 files changed
+29 -6

No files matched your search

+5 -1
View File
@@ -79,8 +79,12 @@ export function createCyclonesLayer({
return null;
}
selectedContextEntity ||= { show: true };
const contextId = `cyclone:${storm.id}`;
context.removeEntityContextsForLayer?.('weather-cyclones', {
retainIds: new Set([contextId]),
});
const record = context.registerEntityContext?.(selectedContextEntity, {
id: `cyclone:${storm.id}`,
id: contextId,
layerId: 'weather-cyclones',
layerName: 'Cyclone advisories',
source: 'NOAA NHC / CPHC',