From 8f4024fb1238267b460817c41b4ead022560ac99 Mon Sep 17 00:00:00 2001 From: Joy A Date: Fri, 18 Oct 2024 14:36:10 +0530 Subject: [PATCH] #1100 | Fix missing address level on reselection --- .../openchs-android/src/action/common/AddressLevelsState.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/openchs-android/src/action/common/AddressLevelsState.js b/packages/openchs-android/src/action/common/AddressLevelsState.js index 4feed8c3e..95981b71c 100644 --- a/packages/openchs-android/src/action/common/AddressLevelsState.js +++ b/packages/openchs-android/src/action/common/AddressLevelsState.js @@ -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(); }