diff --git a/crates/auto_update2/src/auto_update.rs b/crates/auto_update2/src/auto_update.rs index 72dbe32b5a6fbf53304896d9d5d2fbb64d44f8d3..dbccd269b797273277ad98e34d238166fe68df1c 100644 --- a/crates/auto_update2/src/auto_update.rs +++ b/crates/auto_update2/src/auto_update.rs @@ -85,15 +85,7 @@ pub fn init(http_client: Arc, server_url: String, cx: &mut AppCo AutoUpdateSetting::register(cx); cx.observe_new_views(|workspace: &mut Workspace, _cx| { - workspace - .register_action(|_, action: &Check, cx| check(action, cx)) - .register_action(|_, _action: &CheckThatAutoUpdaterWorks, cx| { - let prompt = cx.prompt(gpui::PromptLevel::Info, "It does!", &["Ok"]); - cx.spawn(|_, _cx| async move { - prompt.await.ok(); - }) - .detach(); - }); + workspace.register_action(|_, action: &Check, cx| check(action, cx)); // @nate - code to trigger update notification on launch // workspace.show_notification(0, _cx, |cx| { @@ -130,9 +122,15 @@ pub fn init(http_client: Arc, server_url: String, cx: &mut AppCo } } -pub fn check(_: &Check, cx: &mut AppContext) { +pub fn check(_: &Check, cx: &mut ViewContext) { if let Some(updater) = AutoUpdater::get(cx) { updater.update(cx, |updater, cx| updater.poll(cx)); + } else { + drop(cx.prompt( + gpui::PromptLevel::Info, + "Auto-updates disabled for non-bundled app.", + &["Ok"], + )); } }