From 8f9a64de29d2c8f843d0cdd2cd4b60bf1b9b8e42 Mon Sep 17 00:00:00 2001 From: etorreborre Date: Wed, 29 Nov 2023 17:27:02 +0100 Subject: [PATCH] fix(rust): update the project state when it is ready --- .../rust/ockam/ockam_command/src/enroll/command.rs | 4 +++- .../rust/ockam/ockam_command/src/project/create.rs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/implementations/rust/ockam/ockam_command/src/enroll/command.rs b/implementations/rust/ockam/ockam_command/src/enroll/command.rs index cd53f5ee32c..8b728387cbc 100644 --- a/implementations/rust/ockam/ockam_command/src/enroll/command.rs +++ b/implementations/rust/ockam/ockam_command/src/enroll/command.rs @@ -346,7 +346,9 @@ async fn get_user_project( } }; - check_project_readiness(opts, ctx, node, project.clone()).await?; + let project = check_project_readiness(opts, ctx, node, project.clone()).await?; + // store the updated project + opts.state.store_project(project.clone()).await?; opts.terminal.write_line(&fmt_ok!( "Marked this project as your default project, on this machine.\n" diff --git a/implementations/rust/ockam/ockam_command/src/project/create.rs b/implementations/rust/ockam/ockam_command/src/project/create.rs index e180256b4a0..4330d793ca2 100644 --- a/implementations/rust/ockam/ockam_command/src/project/create.rs +++ b/implementations/rust/ockam/ockam_command/src/project/create.rs @@ -58,6 +58,8 @@ async fn run_impl( let controller = node.create_controller().await?; check_for_completion(&opts, ctx, &controller, &operation_id).await?; let project = check_project_readiness(&opts, ctx, &node, project).await?; + // update the project state when it's ready + opts.state.store_project(project.clone()).await?; opts.println(&project)?; Ok(()) }