assistant panel: Fix entering credentials not updating view (#15527)

Co-authored-by: Bennet <bennet@zed.dev>

Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
This commit is contained in:
Thorsten Ball 2024-07-31 12:51:41 +02:00 committed by GitHub
parent c78ea0df7e
commit b571bc800d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 92 additions and 52 deletions

View file

@ -50,7 +50,7 @@ pub struct CloudLanguageModelProvider {
_maintain_client_status: Task<()>,
}
struct State {
pub struct State {
client: Arc<Client>,
status: client::Status,
_subscription: Subscription,
@ -99,10 +99,10 @@ impl CloudLanguageModelProvider {
}
impl LanguageModelProviderState for CloudLanguageModelProvider {
fn subscribe<T: 'static>(&self, cx: &mut gpui::ModelContext<T>) -> Option<gpui::Subscription> {
Some(cx.observe(&self.state, |_, _, cx| {
cx.notify();
}))
type ObservableEntity = State;
fn observable_entity(&self) -> Option<gpui::Model<Self::ObservableEntity>> {
Some(self.state.clone())
}
}