mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-26 10:40:54 +00:00
Fix bug when determining contact status
Users are sorted by login but we were binary-searching them by id. Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
d4e6ab4975
commit
93688cbe22
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue