Skip to content

Commit 13a7d2f

Browse files
Merge pull request #1749 from smartdevicelink/bugfix/issue_1748
Get loadedCells if developer tries to present a recreated choiceset
2 parents 6023082 + cd4131b commit 13a7d2f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PreloadPresentChoicesOperation.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,13 @@ void makeCellsToUploadUnique(ArrayList<ChoiceCell> cellsToUpload) {
629629

630630
private void updateChoiceSet(ChoiceSet choiceSet, HashSet<ChoiceCell> loadedCells, HashSet<ChoiceCell> cellsToUpload) {
631631
ArrayList<ChoiceCell> choiceSetCells = new ArrayList<>();
632+
ArrayList<ChoiceCell> loadedCellsList = new ArrayList<>(loadedCells);
633+
ArrayList<ChoiceCell> CellsToUploadList = new ArrayList<>(cellsToUpload);
632634
for (ChoiceCell cell : choiceSet.getChoices()) {
633-
if (loadedCells.contains(cell) || cellsToUpload.contains(cell)) {
634-
choiceSetCells.add(cell);
635+
if (loadedCells.contains(cell)) {
636+
choiceSetCells.add(loadedCellsList.get(loadedCellsList.indexOf(cell)));
637+
} else if (cellsToUpload.contains(cell)) {
638+
choiceSetCells.add(CellsToUploadList.get(CellsToUploadList.indexOf(cell)));
635639
}
636640
}
637641
this.choiceSet.setChoices((List<ChoiceCell>) choiceSetCells.clone());

0 commit comments

Comments
 (0)