ai onboarding: Don't show API keys section if user is already in Pro (#34867)
Release Notes: - N/A
This commit is contained in:
parent
eaccd542fd
commit
2b671a46f2
1 changed files with 10 additions and 4 deletions
|
@ -1657,11 +1657,16 @@ impl Render for MessageEditor {
|
||||||
|
|
||||||
let line_height = TextSize::Small.rems(cx).to_pixels(window.rem_size()) * 1.5;
|
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(),
|
self.user_store.read(cx).current_plan(),
|
||||||
Some(proto::Plan::ZedProTrial)
|
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)> =
|
let configured_providers: Vec<(IconName, SharedString)> =
|
||||||
LanguageModelRegistry::read_global(cx)
|
LanguageModelRegistry::read_global(cx)
|
||||||
.providers()
|
.providers()
|
||||||
|
@ -1676,9 +1681,10 @@ impl Render for MessageEditor {
|
||||||
v_flex()
|
v_flex()
|
||||||
.size_full()
|
.size_full()
|
||||||
.bg(cx.theme().colors().panel_background)
|
.bg(cx.theme().colors().panel_background)
|
||||||
.when(has_existing_providers && !enrolled_in_trial, |this| {
|
.when(
|
||||||
this.child(cx.new(ApiKeysWithProviders::new))
|
has_existing_providers && !in_pro_trial && !pro_user,
|
||||||
})
|
|this| this.child(cx.new(ApiKeysWithProviders::new)),
|
||||||
|
)
|
||||||
.when(changed_buffers.len() > 0, |parent| {
|
.when(changed_buffers.len() > 0, |parent| {
|
||||||
parent.child(self.render_edits_bar(&changed_buffers, window, cx))
|
parent.child(self.render_edits_bar(&changed_buffers, window, cx))
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue