diff --git a/crates/collab_ui/src/collab_titlebar_item.rs b/crates/collab_ui/src/collab_titlebar_item.rs index 8d3b10d38e..ed77b26672 100644 --- a/crates/collab_ui/src/collab_titlebar_item.rs +++ b/crates/collab_ui/src/collab_titlebar_item.rs @@ -134,9 +134,12 @@ impl View for CollabTitlebarItem { } impl CollabTitlebarItem { - pub fn new(workspace: &ViewHandle, cx: &mut ViewContext) -> Self { + pub fn new( + workspace: &ViewHandle, + user_store: ModelHandle, + cx: &mut ViewContext, + ) -> Self { let active_call = ActiveCall::global(cx); - let user_store = workspace.read(cx).user_store().clone(); let mut subscriptions = Vec::new(); subscriptions.push(cx.observe(workspace, |_, _, cx| cx.notify())); subscriptions.push(cx.observe(&active_call, |this, _, cx| this.active_call_changed(cx))); diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index 40c30f7560..8126e788db 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -302,7 +302,9 @@ pub fn initialize_workspace( cx.emit(workspace::Event::PaneAdded(workspace.active_pane().clone())); cx.emit(workspace::Event::PaneAdded(workspace.dock_pane().clone())); - let collab_titlebar_item = cx.add_view(|cx| CollabTitlebarItem::new(&workspace_handle, cx)); + let collab_titlebar_item = cx.add_view(|cx| { + CollabTitlebarItem::new(&workspace_handle, app_state.user_store.clone(), cx) + }); workspace.set_titlebar_item(collab_titlebar_item.into_any(), cx); let project_panel = ProjectPanel::new(workspace.project().clone(), cx);