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 <tomholford@users.noreply.github.com>

Release Notes:

- Made update notification to dismiss when viewing releases notes
This commit is contained in:
tomholford 2024-02-02 12:52:28 -08:00 committed by GitHub
parent 2d58226a9b
commit f2ba969d5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
})),
);
}
}