Skip to content
Snippets Groups Projects
Commit 9eb594cc authored by Fodor Patrik's avatar Fodor Patrik :ghost:
Browse files

New query

parent 34723b8b
Branches
No related tags found
No related merge requests found
......@@ -56,6 +56,23 @@ val likeableUsers
},
)
suspend fun getNextLikeableUser(likedUserList: List<String>): User? =
suspendCoroutine { continuation ->
db
.collection("users")
.whereNotIn("id", likedUserList)
.limit(1)
.get()
.addOnSuccessListener {
continuation.resume(
if (it.size() > 0) it.toObjects(User::class.java)[0] else null
)
}
.addOnFailureListener {
continuation.resumeWithException(it)
}
}
val userData
get(): Flow<User> = callbackFlow {
firebaseUser?.let {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment