Check if user is not already selected
This commit is contained in:
parent
ddb49da7f3
commit
841a24a3a4
2 changed files with 4 additions and 6 deletions
|
|
@ -26,7 +26,9 @@ class UserListDataStore @Inject constructor() {
|
|||
private val selectedUsers: MutableStateFlow<List<MatrixUser>> = MutableStateFlow(emptyList())
|
||||
|
||||
fun selectUser(user: MatrixUser) {
|
||||
selectedUsers.tryEmit(selectedUsers.value.plus(user))
|
||||
if (user !in selectedUsers.value) {
|
||||
selectedUsers.tryEmit(selectedUsers.value.plus(user))
|
||||
}
|
||||
}
|
||||
|
||||
fun removeUserFromSelection(user: MatrixUser) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue