mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03: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
@ -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 New Issue
Block a user