Clear Copilot suggestions when it gets disabled from the settings

This commit is contained in:
Antonio Scandurra
2023-04-04 10:45:56 +02:00
parent abf158a9e4
commit 79d5bb45dc
5 changed files with 26 additions and 35 deletions
+1 -9
View File
@@ -191,16 +191,8 @@ impl View for WelcomePage {
impl WelcomePage {
pub fn new(cx: &mut ViewContext<Self>) -> Self {
let handle = cx.weak_handle();
let settings_subscription = cx.observe_global::<Settings, _>(move |cx| {
if let Some(handle) = handle.upgrade(cx) {
handle.update(cx, |_, cx| cx.notify())
}
});
WelcomePage {
_settings_subscription: settings_subscription,
_settings_subscription: cx.observe_global::<Settings, _>(move |_, cx| cx.notify()),
}
}
}