Avoid applying outdated UpdateProject methods after rejoining a room
This commit is contained in:
parent
1ccf174388
commit
1159f5517b
2 changed files with 6 additions and 2 deletions
|
@ -424,7 +424,7 @@ impl Room {
|
||||||
false
|
false
|
||||||
});
|
});
|
||||||
|
|
||||||
let response = self.client.request(proto::RejoinRoom {
|
let response = self.client.request_envelope(proto::RejoinRoom {
|
||||||
id: self.id,
|
id: self.id,
|
||||||
reshared_projects,
|
reshared_projects,
|
||||||
rejoined_projects,
|
rejoined_projects,
|
||||||
|
@ -432,6 +432,8 @@ impl Room {
|
||||||
|
|
||||||
cx.spawn(|this, mut cx| async move {
|
cx.spawn(|this, mut cx| async move {
|
||||||
let response = response.await?;
|
let response = response.await?;
|
||||||
|
let message_id = response.message_id;
|
||||||
|
let response = response.payload;
|
||||||
let room_proto = response.room.ok_or_else(|| anyhow!("invalid room"))?;
|
let room_proto = response.room.ok_or_else(|| anyhow!("invalid room"))?;
|
||||||
this.update(&mut cx, |this, cx| {
|
this.update(&mut cx, |this, cx| {
|
||||||
this.status = RoomStatus::Online;
|
this.status = RoomStatus::Online;
|
||||||
|
@ -448,7 +450,7 @@ impl Room {
|
||||||
for rejoined_project in response.rejoined_projects {
|
for rejoined_project in response.rejoined_projects {
|
||||||
if let Some(project) = projects.get(&rejoined_project.id) {
|
if let Some(project) = projects.get(&rejoined_project.id) {
|
||||||
project.update(cx, |project, cx| {
|
project.update(cx, |project, cx| {
|
||||||
project.rejoined(rejoined_project, cx).log_err();
|
project.rejoined(rejoined_project, message_id, cx).log_err();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1089,8 +1089,10 @@ impl Project {
|
||||||
pub fn rejoined(
|
pub fn rejoined(
|
||||||
&mut self,
|
&mut self,
|
||||||
message: proto::RejoinedProject,
|
message: proto::RejoinedProject,
|
||||||
|
message_id: u32,
|
||||||
cx: &mut ModelContext<Self>,
|
cx: &mut ModelContext<Self>,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
|
self.join_project_response_message_id = message_id;
|
||||||
self.set_worktrees_from_proto(message.worktrees, cx)?;
|
self.set_worktrees_from_proto(message.worktrees, cx)?;
|
||||||
self.set_collaborators_from_proto(message.collaborators, cx)?;
|
self.set_collaborators_from_proto(message.collaborators, cx)?;
|
||||||
self.language_server_statuses = message
|
self.language_server_statuses = message
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue