mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-03 17:44:30 +00:00
commit
6095525b56
2 changed files with 17 additions and 18 deletions
|
@ -284,21 +284,6 @@ impl ActiveCall {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn toggle_screen_sharing(&self, cx: &mut AppContext) {
|
|
||||||
if let Some(room) = self.room().cloned() {
|
|
||||||
let toggle_screen_sharing = room.update(cx, |room, cx| {
|
|
||||||
if room.is_screen_sharing() {
|
|
||||||
self.report_call_event("disable screen share", cx);
|
|
||||||
Task::ready(room.unshare_screen(cx))
|
|
||||||
} else {
|
|
||||||
self.report_call_event("enable screen share", cx);
|
|
||||||
room.share_screen(cx)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
toggle_screen_sharing.detach_and_log_err(cx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn share_project(
|
pub fn share_project(
|
||||||
&mut self,
|
&mut self,
|
||||||
project: ModelHandle<Project>,
|
project: ModelHandle<Project>,
|
||||||
|
|
|
@ -64,10 +64,24 @@ pub fn toggle_screen_sharing(_: &ToggleScreenSharing, cx: &mut AppContext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn toggle_mute(_: &ToggleMute, cx: &mut AppContext) {
|
pub fn toggle_mute(_: &ToggleMute, cx: &mut AppContext) {
|
||||||
|
let call = ActiveCall::global(cx).read(cx);
|
||||||
if let Some(room) = ActiveCall::global(cx).read(cx).room().cloned() {
|
if let Some(room) = ActiveCall::global(cx).read(cx).room().cloned() {
|
||||||
room.update(cx, Room::toggle_mute)
|
let client = call.client();
|
||||||
.map(|task| task.detach_and_log_err(cx))
|
room.update(cx, |room, cx| {
|
||||||
.log_err();
|
if room.is_muted() {
|
||||||
|
ActiveCall::report_call_event_for_room("enable microphone", room.id(), &client, cx);
|
||||||
|
} else {
|
||||||
|
ActiveCall::report_call_event_for_room(
|
||||||
|
"disable microphone",
|
||||||
|
room.id(),
|
||||||
|
&client,
|
||||||
|
cx,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
room.toggle_mute(cx)
|
||||||
|
})
|
||||||
|
.map(|task| task.detach_and_log_err(cx))
|
||||||
|
.log_err();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue