From 59aaf4ce1b69d80734af06e572235e165941c8e6 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Sat, 8 Oct 2022 14:43:41 +0200 Subject: [PATCH] Call contact on enter --- crates/collab_ui/src/contacts_popover.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/collab_ui/src/contacts_popover.rs b/crates/collab_ui/src/contacts_popover.rs index 672201590a5adf0e3cddf14c424bf93b0b131936..700c7179624f603787ed0f91a86f11859201f0c3 100644 --- a/crates/collab_ui/src/contacts_popover.rs +++ b/crates/collab_ui/src/contacts_popover.rs @@ -282,6 +282,17 @@ impl ContactsPopover { let section = *section; self.toggle_expanded(&ToggleExpanded(section), cx); } + ContactEntry::Contact(contact) => { + if contact.online && !contact.busy { + self.call( + &Call { + recipient_user_id: contact.user.id, + initial_project: Some(self.project.clone()), + }, + cx, + ); + } + } _ => {} } } @@ -636,6 +647,7 @@ impl ContactsPopover { cx: &mut RenderContext, ) -> ElementBox { let online = contact.online; + let busy = contact.busy; let user_id = contact.user.id; let initial_project = project.clone(); let mut element = @@ -688,7 +700,7 @@ impl ContactsPopover { .boxed() }) .on_click(MouseButton::Left, move |_, cx| { - if online { + if online && !busy { cx.dispatch_action(Call { recipient_user_id: user_id, initial_project: Some(initial_project.clone()),