agent: Dismiss the agent panel notification if window is closed (#34230)
Closes https://github.com/zed-industries/zed/issues/32951 Release Notes: - agent: Fixed an issue where the agent panel notification would linger on even after you closed the window.
This commit is contained in:
parent
c6603e4fba
commit
9d2b7c8033
1 changed files with 13 additions and 0 deletions
|
@ -787,6 +787,15 @@ impl ActiveThread {
|
|||
.unwrap()
|
||||
}
|
||||
});
|
||||
|
||||
let workspace_subscription = if let Some(workspace) = workspace.upgrade() {
|
||||
Some(cx.observe_release(&workspace, |this, _, cx| {
|
||||
this.dismiss_notifications(cx);
|
||||
}))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let mut this = Self {
|
||||
language_registry,
|
||||
thread_store,
|
||||
|
@ -834,6 +843,10 @@ impl ActiveThread {
|
|||
}
|
||||
}
|
||||
|
||||
if let Some(subscription) = workspace_subscription {
|
||||
this._subscriptions.push(subscription);
|
||||
}
|
||||
|
||||
this
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue