Changed the on-click behavior of joining a channel to not open the chat, and only open 1 project instead of all projects
Co-authored-by: conrad <conrad.irwin@gmail.com> Co-authored-by: max <max@zed.dev>
This commit is contained in:
parent
e548572f12
commit
dd0edcd203
2 changed files with 12 additions and 25 deletions
|
@ -3208,27 +3208,16 @@ impl CollabPanel {
|
|||
.update(&mut cx, |call, cx| call.join_channel(channel_id, cx))
|
||||
.await?;
|
||||
|
||||
let tasks = room.update(&mut cx, |room, cx| {
|
||||
let Some(workspace) = workspace.upgrade(cx) else {
|
||||
return vec![];
|
||||
};
|
||||
let projects = room.projects_to_join();
|
||||
|
||||
if projects.is_empty() {
|
||||
ChannelView::open(channel_id, workspace, cx).detach();
|
||||
return vec![];
|
||||
}
|
||||
room.projects_to_join()
|
||||
.into_iter()
|
||||
.map(|(project_id, user_id)| {
|
||||
let app_state = workspace.read(cx).app_state().clone();
|
||||
workspace::join_remote_project(project_id, user_id, app_state, cx)
|
||||
})
|
||||
.collect()
|
||||
let task = room.update(&mut cx, |room, cx| {
|
||||
let workspace = workspace.upgrade(cx)?;
|
||||
let (project, host) = room.most_active_project()?;
|
||||
let app_state = workspace.read(cx).app_state().clone();
|
||||
Some(workspace::join_remote_project(project, host, app_state, cx))
|
||||
});
|
||||
for task in tasks {
|
||||
if let Some(task) = task {
|
||||
task.await?;
|
||||
}
|
||||
|
||||
anyhow::Ok(())
|
||||
})
|
||||
.detach_and_log_err(cx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue