From e5192a4853ca514f1130b8c5123c479c13c0fd88 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 21 Apr 2023 11:07:34 +0200 Subject: [PATCH] Use update_default_global to filter command palette items for copilot --- crates/copilot/src/copilot.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/copilot/src/copilot.rs b/crates/copilot/src/copilot.rs index 182db084a1d2cc0452d545b102abafb7fc7d8861..1f826474180e2250cf4c219497b6c7da34c7bac7 100644 --- a/crates/copilot/src/copilot.rs +++ b/crates/copilot/src/copilot.rs @@ -48,8 +48,8 @@ pub fn init(http: Arc, node_runtime: Arc, cx: &mut cx.observe(&copilot, |handle, cx| { let status = handle.read(cx).status(); - cx.update_global::( - move |filter, _cx| match status { + cx.update_default_global::(move |filter, _cx| { + match status { Status::Disabled => { filter.filtered_namespaces.insert(COPILOT_NAMESPACE); filter.filtered_namespaces.insert(COPILOT_AUTH_NAMESPACE); @@ -62,8 +62,8 @@ pub fn init(http: Arc, node_runtime: Arc, cx: &mut filter.filtered_namespaces.insert(COPILOT_NAMESPACE); filter.filtered_namespaces.remove(COPILOT_AUTH_NAMESPACE); } - }, - ); + } + }); }) .detach();