Merge pull request #1825 from zed-industries/update-notification-release-channel

Indicate release channel in auto-update notification
This commit is contained in:
Max Brunsfeld 2022-10-27 11:00:16 -07:00 committed by GitHub
commit eaebec88c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,7 @@ use gpui::{
Element, Entity, MouseButton, View, ViewContext, Element, Entity, MouseButton, View, ViewContext,
}; };
use menu::Cancel; use menu::Cancel;
use settings::Settings; use settings::{ReleaseChannel, Settings};
use workspace::Notification; use workspace::Notification;
pub struct UpdateNotification { pub struct UpdateNotification {
@ -29,13 +29,19 @@ impl View for UpdateNotification {
let theme = cx.global::<Settings>().theme.clone(); let theme = cx.global::<Settings>().theme.clone();
let theme = &theme.update_notification; let theme = &theme.update_notification;
let app_name = match *cx.global::<ReleaseChannel>() {
ReleaseChannel::Dev => "Zed Dev",
ReleaseChannel::Preview => "Zed Preview",
ReleaseChannel::Stable => "Zed",
};
MouseEventHandler::<ViewReleaseNotes>::new(0, cx, |state, cx| { MouseEventHandler::<ViewReleaseNotes>::new(0, cx, |state, cx| {
Flex::column() Flex::column()
.with_child( .with_child(
Flex::row() Flex::row()
.with_child( .with_child(
Text::new( Text::new(
format!("Updated to Zed {}", self.version), format!("Updated to {app_name} {}", self.version),
theme.message.text.clone(), theme.message.text.clone(),
) )
.contained() .contained()