delete empty options on poll creation

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2022-07-14 17:01:55 +02:00 committed by Andy Scherzinger (Rebase PR Action)
parent e77fb7cefb
commit 2ac1567f5d

View file

@ -106,6 +106,8 @@ class PollCreateViewModel @Inject constructor(private val repository: PollReposi
resultMode = 1
}
_options.value = _options.value?.filter { it.pollOption.isNotEmpty() } as ArrayList<PollCreateOptionItem>
if (_question.isNotEmpty() && _options.value?.isNotEmpty() == true) {
repository.createPoll(
roomToken, _question, _options.value!!.map { it.pollOption }, resultMode,