Fix own profile showing up in search friends
This commit is contained in:
parent
9eab533251
commit
ef08a773f8
1 changed files with 3 additions and 3 deletions
|
@ -10,7 +10,7 @@ import be.ugent.sel.studeez.navigation.StudeezDestinations
|
||||||
import be.ugent.sel.studeez.screens.StudeezViewModel
|
import be.ugent.sel.studeez.screens.StudeezViewModel
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.filter
|
import kotlinx.coroutines.flow.map
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@HiltViewModel
|
@HiltViewModel
|
||||||
|
@ -49,8 +49,8 @@ class SearchFriendsViewModel @Inject constructor(
|
||||||
*/
|
*/
|
||||||
fun getAllUsers(): Flow<List<User>> {
|
fun getAllUsers(): Flow<List<User>> {
|
||||||
return userDAO.getAllUsers()
|
return userDAO.getAllUsers()
|
||||||
.filter { users ->
|
.map { users ->
|
||||||
users.any { user ->
|
users.filter { user ->
|
||||||
user.id != userDAO.getCurrentUserId()
|
user.id != userDAO.getCurrentUserId()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue