From f2ba969d5b409d3ed5637ae36b49ed1f6a542d3e Mon Sep 17 00:00:00 2001 From: tomholford <16504501+tomholford@users.noreply.github.com> Date: Fri, 2 Feb 2024 12:52:28 -0800 Subject: [PATCH] Dismiss update notification when viewing releases notes (#7297) After updating zed, a notification is shown in the bottom right with the new version number, a link to the release notes, and an 'x' to dismiss the dialog. Before this PR, clicking the link to the release notes would not dismiss the modal. So, a user returning to the IDE after viewing the notes in the browser would still see the notification. With this change, clicking 'View release notes' also dismisses the notification. Co-authored-by: tomholford Release Notes: - Made update notification to dismiss when viewing releases notes --- crates/auto_update/src/update_notification.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/auto_update/src/update_notification.rs b/crates/auto_update/src/update_notification.rs index eece0c105a1ecaa4d85a533a59fed01c01368681..1dbee718061385dd057e040c201bd83d04582dcf 100644 --- a/crates/auto_update/src/update_notification.rs +++ b/crates/auto_update/src/update_notification.rs @@ -40,10 +40,11 @@ impl Render for UpdateNotification { .id("notes") .child(Label::new("View the release notes")) .cursor_pointer() - .on_click(|_, cx| { + .on_click(cx.listener(|this, _, cx| { crate::view_release_notes(&Default::default(), cx); - }), - ) + this.dismiss(&menu::Cancel, cx) + })), + ); } }