Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
auto-updates: Do not poll for updates on dev channel (#13311)
Thorsten Ballc20a1ee03275
diff --git a/crates/auto_update/src/auto_update.rs b/crates/auto_update/src/auto_update.rsindex cc7fd0a2b7f..1231d632d6d 100644--- a/crates/auto_update/src/auto_update.rs+++ b/crates/auto_update/src/auto_update.rs@@ -141,8 +141,13 @@ pub fn init(http_client: Arc<HttpClientWithUrl>, cx: &mut AppContext) {let auto_updater = cx.new_model(|cx| {let updater = AutoUpdater::new(version, http_client);+ let poll_for_updates = ReleaseChannel::try_global(cx)+ .map(|channel| channel.poll_for_updates())+ .unwrap_or(false);+if option_env!("ZED_UPDATE_EXPLANATION").is_none()&& env::var("ZED_UPDATE_EXPLANATION").is_err()+ && poll_for_updates{let mut update_subscription = AutoUpdateSetting::get_global(cx).0@@ -186,6 +191,13 @@ pub fn check(_: &Check, cx: &mut WindowContext) {return;}+ if !ReleaseChannel::try_global(cx)+ .map(|channel| channel.poll_for_updates())+ .unwrap_or(false)+ {+ return;+ }+if let Some(updater) = AutoUpdater::get(cx) {updater.update(cx, |updater, cx| updater.poll(cx));} else {diff --git a/crates/release_channel/src/lib.rs b/crates/release_channel/src/lib.rsindex b4fda53d79f..2955384a488 100644--- a/crates/release_channel/src/lib.rs+++ b/crates/release_channel/src/lib.rs@@ -118,6 +118,14 @@ impl ReleaseChannel {.map(|channel| channel.0)}+ /// Returns whether we want to poll for updates for this [`ReleaseChannel`]+ pub fn poll_for_updates(&self) -> bool {+ match self {+ ReleaseChannel::Dev => false,+ _ => true,+ }+ }+/// Returns the display name for this [`ReleaseChannel`].pub fn display_name(&self) -> &'static str {match self {