Use update_default_global to filter command palette items for copilot

Antonio Scandurra created

Change summary

crates/copilot/src/copilot.rs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

Detailed changes

crates/copilot/src/copilot.rs 🔗

@@ -48,8 +48,8 @@ pub fn init(http: Arc<dyn HttpClient>, node_runtime: Arc<NodeRuntime>, cx: &mut
 
     cx.observe(&copilot, |handle, cx| {
         let status = handle.read(cx).status();
-        cx.update_global::<collections::CommandPaletteFilter, _, _>(
-            move |filter, _cx| match status {
+        cx.update_default_global::<collections::CommandPaletteFilter, _, _>(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<dyn HttpClient>, node_runtime: Arc<NodeRuntime>, cx: &mut
                     filter.filtered_namespaces.insert(COPILOT_NAMESPACE);
                     filter.filtered_namespaces.remove(COPILOT_AUTH_NAMESPACE);
                 }
-            },
-        );
+            }
+        });
     })
     .detach();