mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-11 05:00:16 +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
|
ContactRequestStatus::Pending
|
||||||
} else if self
|
} else if self
|
||||||
.contacts
|
.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()
|
.is_ok()
|
||||||
{
|
{
|
||||||
ContactRequestStatus::RequestAccepted
|
ContactRequestStatus::RequestAccepted
|
||||||
} else if self
|
} else if self
|
||||||
.outgoing_contact_requests
|
.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()
|
.is_ok()
|
||||||
{
|
{
|
||||||
ContactRequestStatus::RequestSent
|
ContactRequestStatus::RequestSent
|
||||||
} else if self
|
} else if self
|
||||||
.incoming_contact_requests
|
.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()
|
.is_ok()
|
||||||
{
|
{
|
||||||
ContactRequestStatus::RequestReceived
|
ContactRequestStatus::RequestReceived
|
||||||
|
|
Loading…
Reference in a new issue