From 93688cbe22ee4d158f0bfbd09ac46bd9855e4570 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 10 May 2022 17:26:53 +0200 Subject: [PATCH] Fix bug when determining contact status Users are sorted by login but we were binary-searching them by id. Co-Authored-By: Nathan Sobo --- crates/client/src/user.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/client/src/user.rs b/crates/client/src/user.rs index 3f52b2b6d9..8a4f723dfe 100644 --- a/crates/client/src/user.rs +++ b/crates/client/src/user.rs @@ -283,19 +283,19 @@ impl UserStore { ContactRequestStatus::Pending } else if self .contacts - .binary_search_by_key(&&user.id, |contact| &contact.user.id) + .binary_search_by_key(&&user.github_login, |contact| &contact.user.github_login) .is_ok() { ContactRequestStatus::RequestAccepted } else if self .outgoing_contact_requests - .binary_search_by_key(&&user.id, |user| &user.id) + .binary_search_by_key(&&user.github_login, |user| &user.github_login) .is_ok() { ContactRequestStatus::RequestSent } else if self .incoming_contact_requests - .binary_search_by_key(&&user.id, |user| &user.id) + .binary_search_by_key(&&user.github_login, |user| &user.github_login) .is_ok() { ContactRequestStatus::RequestReceived