🎨 Remove unnecessary JoinProjectParams struct
This commit is contained in:
parent
184a454f6f
commit
eee1cec3d4
2 changed files with 9 additions and 13 deletions
|
@ -97,7 +97,10 @@ pub struct OpenPaths {
|
|||
pub struct ToggleFollow(pub PeerId);
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct JoinProject(pub JoinProjectParams);
|
||||
pub struct JoinProject {
|
||||
pub project_id: u64,
|
||||
pub app_state: Arc<AppState>,
|
||||
}
|
||||
|
||||
impl_internal_actions!(
|
||||
workspace,
|
||||
|
@ -115,7 +118,7 @@ pub fn init(client: &Arc<Client>, cx: &mut MutableAppContext) {
|
|||
open_new(&action.0, cx)
|
||||
});
|
||||
cx.add_global_action(move |action: &JoinProject, cx: &mut MutableAppContext| {
|
||||
join_project(action.0.project_id, &action.0.app_state, cx).detach();
|
||||
join_project(action.project_id, &action.app_state, cx).detach();
|
||||
});
|
||||
|
||||
cx.add_action(Workspace::toggle_share);
|
||||
|
@ -187,12 +190,6 @@ pub struct AppState {
|
|||
) -> Workspace,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct JoinProjectParams {
|
||||
pub project_id: u64,
|
||||
pub app_state: Arc<AppState>,
|
||||
}
|
||||
|
||||
pub trait Item: View {
|
||||
fn deactivated(&mut self, _: &mut ViewContext<Self>) {}
|
||||
fn navigate(&mut self, _: Box<dyn Any>, _: &mut ViewContext<Self>) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue