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:
parent
c78ea0df7e
commit
b571bc800d
10 changed files with 92 additions and 52 deletions
|
@ -45,7 +45,7 @@ pub struct OpenAiLanguageModelProvider {
|
|||
state: gpui::Model<State>,
|
||||
}
|
||||
|
||||
struct State {
|
||||
pub struct State {
|
||||
api_key: Option<String>,
|
||||
_subscription: Subscription,
|
||||
}
|
||||
|
@ -64,10 +64,10 @@ impl OpenAiLanguageModelProvider {
|
|||
}
|
||||
|
||||
impl LanguageModelProviderState for OpenAiLanguageModelProvider {
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue