Skip to content

Commit

Permalink
Add condition to not populate string value if it's empty (google#2521)
Browse files Browse the repository at this point in the history
* Add condition to not populate string value if it's empty

* Revert "Add condition to not populate string value if it's empty"

This reverts commit 6f652e1.

* Filter only non-empty text should be saved

* spotless

* Address review
  • Loading branch information
FikriMilano authored and ndegwamartin committed Sep 10, 2024
1 parent 2036be9 commit 8d64417
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,13 @@ internal class OptionSelectDialogFragment(
SelectedOptions(
options = currentList.filterIsInstance<OptionSelectRow.Option>().map { it.option },
otherOptions =
currentList.filterIsInstance<OptionSelectRow.OtherEditText>().map { it.currentText },
currentList
.filterIsInstance<OptionSelectRow.OtherEditText>()
.filter {
it.currentText.isNotEmpty()
} // Filters out empty answers when the user inputs nothing into a new option choice
// edit text field.
.map { it.currentText },
),
)
}
Expand Down

0 comments on commit 8d64417

Please sign in to comment.