From 3025e5620d249da498043b125f8bb194c4bee1d2 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Wed, 31 Jan 2024 16:28:32 -0700 Subject: [PATCH] Tell the user when screen-sharing fails (#7171) Release Notes: - Added an alert when screen-sharing fails --- crates/collab_ui/src/collab_ui.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/collab_ui/src/collab_ui.rs b/crates/collab_ui/src/collab_ui.rs index befdf5db7419da23130ccd72bfb52c1c7cb5dbe6..76894ec17f51684611dff618fa03c4267f3f33c0 100644 --- a/crates/collab_ui/src/collab_ui.rs +++ b/crates/collab_ui/src/collab_ui.rs @@ -14,13 +14,13 @@ pub use collab_panel::CollabPanel; pub use collab_titlebar_item::CollabTitlebarItem; use gpui::{ actions, point, AppContext, GlobalPixels, Pixels, PlatformDisplay, Size, Task, WindowBounds, - WindowKind, WindowOptions, + WindowContext, WindowKind, WindowOptions, }; pub use panel_settings::{ ChatPanelSettings, CollaborationPanelSettings, NotificationPanelSettings, }; use settings::Settings; -use workspace::AppState; +use workspace::{notifications::DetachAndPromptErr, AppState}; actions!( collab, @@ -41,7 +41,7 @@ pub fn init(app_state: &Arc, cx: &mut AppContext) { notifications::init(&app_state, cx); } -pub fn toggle_screen_sharing(_: &ToggleScreenSharing, cx: &mut AppContext) { +pub fn toggle_screen_sharing(_: &ToggleScreenSharing, cx: &mut WindowContext) { let call = ActiveCall::global(cx).read(cx); if let Some(room) = call.room().cloned() { let client = call.client(); @@ -64,7 +64,7 @@ pub fn toggle_screen_sharing(_: &ToggleScreenSharing, cx: &mut AppContext) { room.share_screen(cx) } }); - toggle_screen_sharing.detach_and_log_err(cx); + toggle_screen_sharing.detach_and_prompt_err("Sharing Screen Failed", cx, |e, _| Some(format!("{:?}\n\nPlease check that you have given Zed permissions to record your screen in Settings.", e))); } }