Gathering reason input is refactored.
This commit is contained in:
parent
ba0133a047
commit
ce028f8bd2
|
@ -805,7 +805,9 @@ class RoomDetailFragment @Inject constructor(
|
|||
.setView(layout)
|
||||
.setTitle(R.string.delete_event_dialog_title)
|
||||
.setPositiveButton(R.string.remove) { _, _ ->
|
||||
val reason = if (reasonCheckBox.isChecked) reasonInput.text.toString().takeIf { it.isNotBlank() } else null
|
||||
val reason = reasonInput.text.toString()
|
||||
.takeIf { reasonCheckBox.isChecked }
|
||||
?.takeIf { it.isNotBlank() }
|
||||
roomDetailViewModel.handle(RoomDetailAction.RedactAction(eventId, reason))
|
||||
}
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
|
|
Loading…
Reference in New Issue