From a785eb914140bd83e1d0780929261d9f46157848 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Mon, 2 Oct 2023 15:24:09 +0200 Subject: [PATCH] auto-update: Link to the current release's changelog, not the latest one (#3076) An user complained in zed-industries/community#2093 that we always link to the latest release changelog, not the one that they've just updated to. Release Notes: - Fixed changelog link in update notification always leading to the latest release changelog, not the one that was updated to. Fixes zed-industries/community#2093. --- crates/auto_update/src/auto_update.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/auto_update/src/auto_update.rs b/crates/auto_update/src/auto_update.rs index 822886b580..0d537b882a 100644 --- a/crates/auto_update/src/auto_update.rs +++ b/crates/auto_update/src/auto_update.rs @@ -115,13 +115,15 @@ pub fn check(_: &Check, cx: &mut AppContext) { fn view_release_notes(_: &ViewReleaseNotes, cx: &mut AppContext) { if let Some(auto_updater) = AutoUpdater::get(cx) { - let server_url = &auto_updater.read(cx).server_url; + let auto_updater = auto_updater.read(cx); + let server_url = &auto_updater.server_url; + let current_version = auto_updater.current_version; let latest_release_url = if cx.has_global::() && *cx.global::() == ReleaseChannel::Preview { - format!("{server_url}/releases/preview/latest") + format!("{server_url}/releases/preview/{current_version}") } else { - format!("{server_url}/releases/stable/latest") + format!("{server_url}/releases/stable/{current_version}") }; cx.platform().open_url(&latest_release_url); }