Fix detekt issue
Content slots should not be reused in different code branches/scopes of a composable function, to preserve the slot internal state.
This commit is contained in:
parent
82c3d5a689
commit
a6201f2008
1 changed files with 6 additions and 6 deletions
|
|
@ -230,20 +230,20 @@ private fun SearchResultsList(
|
||||||
state = lazyListState,
|
state = lazyListState,
|
||||||
) {
|
) {
|
||||||
item {
|
item {
|
||||||
if (currentRole == RoomMember.Role.Admin) {
|
val usersInHorizontalRow by remember {
|
||||||
val ownersAndSelectedUsers by remember {
|
derivedStateOf {
|
||||||
derivedStateOf {
|
if (currentRole == RoomMember.Role.Admin) {
|
||||||
// Also include the owners in the horizontal list
|
// Also include the owners in the horizontal list
|
||||||
val owners = searchResults.owners.map {
|
val owners = searchResults.owners.map {
|
||||||
it.toMatrixUser()
|
it.toMatrixUser()
|
||||||
}
|
}
|
||||||
(owners + selectedUsers).toImmutableList()
|
(owners + selectedUsers).toImmutableList()
|
||||||
|
} else {
|
||||||
|
selectedUsers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
selectedUsersList(ownersAndSelectedUsers)
|
|
||||||
} else {
|
|
||||||
selectedUsersList(selectedUsers)
|
|
||||||
}
|
}
|
||||||
|
selectedUsersList(usersInHorizontalRow)
|
||||||
}
|
}
|
||||||
if (searchResults.owners.isNotEmpty()) {
|
if (searchResults.owners.isNotEmpty()) {
|
||||||
stickyHeader { ListSectionHeader(text = stringResource(R.string.screen_room_roles_and_permissions_owners)) }
|
stickyHeader { ListSectionHeader(text = stringResource(R.string.screen_room_roles_and_permissions_owners)) }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue