Adding header section only when "@room" is available
This commit is contained in:
parent
11dacbab81
commit
df3fc38054
|
@ -85,10 +85,14 @@ class AutocompleteMemberPresenter @AssistedInject constructor(context: Context,
|
|||
val membersHeader = createMembersHeader()
|
||||
val members = createMemberItems(queryParams)
|
||||
val everyone = createEveryoneItem(query)
|
||||
// add headers only when user can notify everyone
|
||||
val canAddHeaders = canNotifyEveryone()
|
||||
|
||||
val items = mutableListOf<AutocompleteMemberItem>().apply {
|
||||
if (members.isNotEmpty()) {
|
||||
if (canAddHeaders) {
|
||||
add(membersHeader)
|
||||
}
|
||||
addAll(members)
|
||||
}
|
||||
everyone?.let {
|
||||
|
|
Loading…
Reference in New Issue