Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remote_server: Fix opening a new remote project not refreshing the project panel #18262

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions crates/workspace/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5603,6 +5603,9 @@ pub fn join_dev_server_project(
})
});

let serialized_workspace: Option<SerializedWorkspace> =
persistence::DB.workspace_for_dev_server_project(dev_server_project_id);

let workspace = if let Some(existing_workspace) = existing_workspace {
existing_workspace
} else {
Expand All @@ -5616,10 +5619,7 @@ pub fn join_dev_server_project(
)
.await?;

let serialized_workspace: Option<SerializedWorkspace> =
persistence::DB.workspace_for_dev_server_project(dev_server_project_id);

let workspace_id = if let Some(serialized_workspace) = serialized_workspace {
let workspace_id = if let Some(ref serialized_workspace) = serialized_workspace {
serialized_workspace.id
} else {
persistence::DB.next_id().await?
Expand All @@ -5646,10 +5646,13 @@ pub fn join_dev_server_project(
}
};

workspace.update(&mut cx, |_, cx| {
cx.activate(true);
cx.activate_window();
})?;
workspace
.update(&mut cx, |_, cx| {
cx.activate(true);
cx.activate_window();
open_items(serialized_workspace, vec![], app_state, cx)
})?
.await?;

anyhow::Ok(workspace)
})
Expand Down
Loading