assistant2: Hide the status bar icon when disabled via the settings (#22981)

This PR makes it so the status bar icon for Assistant2 is hidden when it
is disabled via the settings.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-01-10 14:44:57 -05:00 committed by GitHub
parent 2f07d53cce
commit 80cc1f174f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -279,7 +279,12 @@ impl Panel for AssistantPanel {
Some(proto::PanelId::AssistantPanel)
}
fn icon(&self, _cx: &WindowContext) -> Option<IconName> {
fn icon(&self, cx: &WindowContext) -> Option<IconName> {
let settings = AssistantSettings::get_global(cx);
if !settings.enabled || !settings.button {
return None;
}
Some(IconName::ZedAssistant2)
}