Skip to content

Commit

Permalink
#1100 | Fix missing address level on reselection
Browse files Browse the repository at this point in the history
  • Loading branch information
1t5j0y committed Oct 18, 2024
1 parent 09ec28c commit 8f4024f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import _ from 'lodash';

function adjustForDisplayedLevels(allCurrentLevels, selectedLevel, newLevels) {
const toRemove = allCurrentLevels.filter(l => !_.isEmpty(l.locationMappings) && l.level < selectedLevel.level && l.parentUuid !== selectedLevel.parentUuid);
return new AddressLevelsState(allCurrentLevels).addLevels(newLevels)
return new AddressLevelsState(allCurrentLevels)
.removeLevels(toRemove)
.addLevels(newLevels)
.removeUnwantedLevels();
}

Expand Down

0 comments on commit 8f4024f

Please sign in to comment.