mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-25 01:34:02 +00:00
Handle participants' participant index changing
This normally doesn't happen, but it can happen if a participant loses connection ungracefully, restarts their app, and then explicitly joins again.
This commit is contained in:
parent
90b54a45e8
commit
b807b3c785
1 changed files with 4 additions and 4 deletions
|
@ -686,6 +686,7 @@ impl Room {
|
||||||
let Some(peer_id) = participant.peer_id else {
|
let Some(peer_id) = participant.peer_id else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
let participant_index = ParticipantIndex(participant.participant_index);
|
||||||
this.participant_user_ids.insert(participant.user_id);
|
this.participant_user_ids.insert(participant.user_id);
|
||||||
|
|
||||||
let old_projects = this
|
let old_projects = this
|
||||||
|
@ -736,8 +737,9 @@ impl Room {
|
||||||
if let Some(remote_participant) =
|
if let Some(remote_participant) =
|
||||||
this.remote_participants.get_mut(&participant.user_id)
|
this.remote_participants.get_mut(&participant.user_id)
|
||||||
{
|
{
|
||||||
remote_participant.projects = participant.projects;
|
|
||||||
remote_participant.peer_id = peer_id;
|
remote_participant.peer_id = peer_id;
|
||||||
|
remote_participant.projects = participant.projects;
|
||||||
|
remote_participant.participant_index = participant_index;
|
||||||
if location != remote_participant.location {
|
if location != remote_participant.location {
|
||||||
remote_participant.location = location;
|
remote_participant.location = location;
|
||||||
cx.emit(Event::ParticipantLocationChanged {
|
cx.emit(Event::ParticipantLocationChanged {
|
||||||
|
@ -749,9 +751,7 @@ impl Room {
|
||||||
participant.user_id,
|
participant.user_id,
|
||||||
RemoteParticipant {
|
RemoteParticipant {
|
||||||
user: user.clone(),
|
user: user.clone(),
|
||||||
participant_index: ParticipantIndex(
|
participant_index,
|
||||||
participant.participant_index,
|
|
||||||
),
|
|
||||||
peer_id,
|
peer_id,
|
||||||
projects: participant.projects,
|
projects: participant.projects,
|
||||||
location,
|
location,
|
||||||
|
|
Loading…
Reference in a new issue