Clear Copilot suggestions when it gets disabled from the settings
This commit is contained in:
parent
abf158a9e4
commit
79d5bb45dc
5 changed files with 26 additions and 35 deletions
|
@ -228,13 +228,8 @@ impl CopilotButton {
|
|||
|
||||
Copilot::global(cx).map(|copilot| cx.observe(&copilot, |_, _, cx| cx.notify()).detach());
|
||||
|
||||
let this_handle = cx.handle().downgrade();
|
||||
cx.observe_global::<Settings, _>(move |cx| {
|
||||
if let Some(handle) = this_handle.upgrade(cx) {
|
||||
handle.update(cx, |_, cx| cx.notify())
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
cx.observe_global::<Settings, _>(move |_, cx| cx.notify())
|
||||
.detach();
|
||||
|
||||
Self {
|
||||
popup_menu: menu,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue