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
|
@ -598,9 +598,8 @@ impl Room {
|
|||
.map_or(&[], |v| v.as_slice())
|
||||
}
|
||||
|
||||
/// projects_to_join returns a list of shared projects sorted such
|
||||
/// that the most 'active' projects appear last.
|
||||
pub fn projects_to_join(&self) -> Vec<(u64, u64)> {
|
||||
/// Returns the most 'active' projects, defined as most people in the project
|
||||
pub fn most_active_project(&self) -> Option<(u64, u64)> {
|
||||
let mut projects = HashMap::default();
|
||||
let mut hosts = HashMap::default();
|
||||
for participant in self.remote_participants.values() {
|
||||
|
@ -617,12 +616,11 @@ impl Room {
|
|||
}
|
||||
|
||||
let mut pairs: Vec<(u64, usize)> = projects.into_iter().collect();
|
||||
pairs.sort_by_key(|(_, count)| 0 - *count as i32);
|
||||
pairs.sort_by_key(|(_, count)| *count as i32);
|
||||
|
||||
pairs
|
||||
.into_iter()
|
||||
.map(|(project_id, _)| (project_id, hosts[&project_id]))
|
||||
.collect()
|
||||
.first()
|
||||
.map(|(project_id, _)| (*project_id, hosts[&project_id]))
|
||||
}
|
||||
|
||||
async fn handle_room_updated(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue