Skip to content

Commit

Permalink
Add condition to not populate string value if it's empty (#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 Sep 4, 2024
1 parent f4041da commit cc0dc19
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 cc0dc19

Please sign in to comment.