fix unsaved change

This commit is contained in:
Kay Simmons 2023-02-03 12:47:20 -08:00
parent 303216291b
commit 3e92e4d110
2 changed files with 4 additions and 21 deletions

View file

@ -1,4 +1,4 @@
use crate::{contact_notification::ContactNotification, contacts_popover};
use crate::{contact_notification::ContactNotification, contacts_popover, ToggleScreenSharing};
use call::{ActiveCall, ParticipantLocation};
use client::{proto::PeerId, Authenticate, ContactEventKind, User, UserStore};
use clock::ReplicaId;
@ -10,21 +10,17 @@ use gpui::{
geometry::{rect::RectF, vector::vec2f, PathBuilder},
json::{self, ToJson},
Border, CursorStyle, Entity, ModelHandle, MouseButton, MutableAppContext, RenderContext,
Subscription, Task, View, ViewContext, ViewHandle, WeakViewHandle,
Subscription, View, ViewContext, ViewHandle, WeakViewHandle,
};
use settings::Settings;
use std::ops::Range;
use theme::Theme;
use workspace::{FollowNextCollaborator, JoinProject, ToggleFollow, Workspace};
actions!(
collab,
[ToggleCollaborationMenu, ToggleScreenSharing, ShareProject]
);
actions!(collab, [ToggleCollaborationMenu, ShareProject]);
pub fn init(cx: &mut MutableAppContext) {
cx.add_action(CollabTitlebarItem::toggle_contacts_popover);
cx.add_global_action(CollabTitlebarItem::toggle_screen_sharing);
cx.add_action(CollabTitlebarItem::share_project);
}
@ -172,19 +168,6 @@ impl CollabTitlebarItem {
cx.notify();
}
pub fn toggle_screen_sharing(_: &ToggleScreenSharing, cx: &mut MutableAppContext) {
if let Some(room) = ActiveCall::global(cx).read(cx).room().cloned() {
let toggle_screen_sharing = room.update(cx, |room, cx| {
if room.is_screen_sharing() {
Task::ready(room.unshare_screen(cx))
} else {
room.share_screen(cx)
}
});
toggle_screen_sharing.detach_and_log_err(cx);
}
}
fn render_toggle_contacts_button(
&self,
theme: &Theme,

View file

@ -6,7 +6,7 @@ use gpui::{
};
use settings::Settings;
use crate::collab_titlebar_item::ToggleScreenSharing;
use crate::ToggleScreenSharing;
pub fn init(cx: &mut MutableAppContext) {
let active_call = ActiveCall::global(cx);