Skip to content

Commit

Permalink
remove children from all painted
Browse files Browse the repository at this point in the history
  • Loading branch information
nofurtherinformation committed Jan 3, 2025
1 parent fd98616 commit e1ee045
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion app/src/app/store/mapStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ export const useMapStore = createWithMiddlewares<MapStore>(
set({mapLock: false})
},
silentlyHeal: async (document_id, parentsToHeal) => {
const {getMapRef, zoneAssignments, mapDocument} = get()
const {getMapRef, zoneAssignments, mapDocument, shatterMappings, allPainted} = get()
const mapRef = getMapRef();
if (!mapRef) return;
set({mapLock: true})
Expand All @@ -505,6 +505,12 @@ export const useMapStore = createWithMiddlewares<MapStore>(
zone: zoneAssignments.get(parentsToHeal[0])!,
document_id
});
const children = shatterMappings[parentsToHeal[0]];
children.forEach(child => {
// remove from allPainted
allPainted.delete(child);
})

parentsToHeal.forEach(parent => {
mapRef?.setFeatureState({
source: BLOCK_SOURCE_ID,
Expand Down Expand Up @@ -624,6 +630,7 @@ export const useMapStore = createWithMiddlewares<MapStore>(
toggleHighlightBrokenDistricts,
lockedFeatures,
getMapRef,
allPainted
} = get();
const idsToCheck = [..._parentsToHeal, ...additionalIds];
const mapRef = getMapRef();
Expand Down Expand Up @@ -654,6 +661,13 @@ export const useMapStore = createWithMiddlewares<MapStore>(
zone: parentsToHeal[0].zone as any,
document_id: mapDocument?.document_id,
});
const children = parentsToHeal.map(f => shatterMappings[f.parentId])
.forEach(childSet => {
childSet.forEach(child => {
// remove from allPainted
allPainted.delete(child);
})
})
toggleHighlightBrokenDistricts(r.geoids, false);
const newZoneAssignments = new Map(zoneAssignments);
const newShatterIds = {
Expand Down

0 comments on commit e1ee045

Please sign in to comment.