Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

agent: Disables multi workspace refresh queue for non-staff (#49496)

Anthony Eid66f7aea1664a
diff --git a/crates/sidebar/src/sidebar.rs b/crates/sidebar/src/sidebar.rs
index e259b86d95d..2dfefcc5be7 100644
--- a/crates/sidebar/src/sidebar.rs
+++ b/crates/sidebar/src/sidebar.rs
@@ -2,6 +2,7 @@ use acp_thread::ThreadStatus;
use agent_ui::{AgentPanel, AgentPanelEvent};
use chrono::{Datelike, Local, NaiveDate, TimeDelta};
use db::kvp::KEY_VALUE_STORE;
+
use fs::Fs;
use fuzzy::StringMatchCandidate;
use gpui::{
@@ -993,6 +994,10 @@ impl Sidebar {
cx: &mut Context<Self>,
) {
cx.defer_in(window, move |this, window, cx| {
+ if !this.multi_workspace.read(cx).multi_workspace_enabled(cx) {
+ return;
+ }
+
this._project_subscriptions = this.subscribe_to_projects(window, cx);
this._agent_panel_subscriptions = this.subscribe_to_agent_panels(window, cx);
this._thread_subscriptions = this.subscribe_to_threads(window, cx);
diff --git a/crates/workspace/src/multi_workspace.rs b/crates/workspace/src/multi_workspace.rs
index 2a528d21e77..75c794cb6f5 100644
--- a/crates/workspace/src/multi_workspace.rs
+++ b/crates/workspace/src/multi_workspace.rs
@@ -144,7 +144,7 @@ impl MultiWorkspace {
.map_or(false, |s| s.has_notifications(cx))
}
- pub(crate) fn multi_workspace_enabled(&self, cx: &App) -> bool {
+ pub fn multi_workspace_enabled(&self, cx: &App) -> bool {
cx.has_flag::<AgentV2FeatureFlag>()
}