agent: Don't render trial upsell when not using the Zed provider (#30029)
This PR makes it so we don't render the trial upsell when not using the Zed provider. Release Notes: - Agent Beta: Changed Zed Pro trial upsell to only be displayed when using a model through the Zed provider.
This commit is contained in:
parent
b83d00d69b
commit
544e8fc46c
1 changed files with 16 additions and 1 deletions
|
@ -27,7 +27,9 @@ use gpui::{
|
|||
linear_gradient, prelude::*, pulsating_between,
|
||||
};
|
||||
use language::LanguageRegistry;
|
||||
use language_model::{LanguageModelProviderTosView, LanguageModelRegistry, RequestUsage};
|
||||
use language_model::{
|
||||
LanguageModelProviderTosView, LanguageModelRegistry, RequestUsage, ZED_CLOUD_PROVIDER_ID,
|
||||
};
|
||||
use language_model_selector::ToggleModelSelector;
|
||||
use project::{Project, ProjectPath, Worktree};
|
||||
use prompt_store::{PromptBuilder, PromptStore, UserPromptId};
|
||||
|
@ -1806,6 +1808,19 @@ impl AssistantPanel {
|
|||
return false;
|
||||
}
|
||||
|
||||
let is_using_zed_provider = self
|
||||
.thread
|
||||
.read(cx)
|
||||
.thread()
|
||||
.read(cx)
|
||||
.configured_model()
|
||||
.map_or(false, |model| {
|
||||
model.provider.id().0 == ZED_CLOUD_PROVIDER_ID
|
||||
});
|
||||
if !is_using_zed_provider {
|
||||
return false;
|
||||
}
|
||||
|
||||
let plan = self.user_store.read(cx).current_plan();
|
||||
if matches!(plan, Some(Plan::ZedPro | Plan::ZedProTrial)) {
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue