fix unsaved change

Kay Simmons created

Change summary

crates/collab_ui/src/collab_titlebar_item.rs     | 23 ++---------------
crates/collab_ui/src/sharing_status_indicator.rs |  2 
2 files changed, 4 insertions(+), 21 deletions(-)

Detailed changes

crates/collab_ui/src/collab_titlebar_item.rs 🔗

@@ -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,

crates/collab_ui/src/sharing_status_indicator.rs 🔗

@@ -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);