added workspace event for WorkspaceCreated (#3222)

added workspace2 event for WorkspaceCreated

Release Notes:

- NA
This commit is contained in:
Kyle Caverly 2023-11-03 11:06:11 -04:00 committed by GitHub
commit 343525d77b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -544,6 +544,7 @@ impl DelayedDebouncedEditAction {
pub enum Event {
PaneAdded(View<Pane>),
ContactRequestedJoin(u64),
WorkspaceCreated(WeakView<Workspace>),
}
pub struct Workspace {
@ -698,8 +699,7 @@ impl Workspace {
Ok(())
});
// todo!("replace with a different mechanism")
// cx.emit_global(WorkspaceCreated(weak_handle.clone()));
cx.emit(Event::WorkspaceCreated(weak_handle.clone()));
let left_dock = cx.build_view(|_| Dock::new(DockPosition::Left));
let bottom_dock = cx.build_view(|_| Dock::new(DockPosition::Bottom));
@ -4253,7 +4253,7 @@ impl ViewId {
// }
// }
// pub struct WorkspaceCreated(pub WeakView<Workspace>);
pub struct WorkspaceCreated(pub WeakView<Workspace>);
pub fn activate_workspace_for_project(
cx: &mut AppContext,