ai onboarding: Don't show API keys section if user is already in Pro (#34867)

Release Notes:

- N/A
This commit is contained in:
Danilo Leal 2025-07-22 02:39:22 -03:00 committed by GitHub
parent eaccd542fd
commit 2b671a46f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1657,11 +1657,16 @@ impl Render for MessageEditor {
let line_height = TextSize::Small.rems(cx).to_pixels(window.rem_size()) * 1.5;
let enrolled_in_trial = matches!(
let in_pro_trial = matches!(
self.user_store.read(cx).current_plan(),
Some(proto::Plan::ZedProTrial)
);
let pro_user = matches!(
self.user_store.read(cx).current_plan(),
Some(proto::Plan::ZedPro)
);
let configured_providers: Vec<(IconName, SharedString)> =
LanguageModelRegistry::read_global(cx)
.providers()
@ -1676,9 +1681,10 @@ impl Render for MessageEditor {
v_flex()
.size_full()
.bg(cx.theme().colors().panel_background)
.when(has_existing_providers && !enrolled_in_trial, |this| {
this.child(cx.new(ApiKeysWithProviders::new))
})
.when(
has_existing_providers && !in_pro_trial && !pro_user,
|this| this.child(cx.new(ApiKeysWithProviders::new)),
)
.when(changed_buffers.len() > 0, |parent| {
parent.child(self.render_edits_bar(&changed_buffers, window, cx))
})