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();