Skip to content

Commit

Permalink
feat: add spinner for Candid UI canister creation (#4094)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericswanson-dfinity authored Feb 1, 2025
1 parent a701813 commit 9fcb5a3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/dfx/src/lib/named_canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use dfx_core::config::model::canister_id_store::CanisterIdStore;
use fn_error_context::context;
use ic_utils::interfaces::management_canister::builders::InstallMode;
use ic_utils::interfaces::ManagementCanister;
use slog::info;
use slog::debug;
use std::io::Read;
use url::{Host::Domain, Url};

Expand All @@ -33,7 +33,8 @@ pub async fn install_ui_canister(
}
fetch_root_key_if_needed(env).await?;
let mgr = ManagementCanister::create(env.get_agent());
info!(
let spinner = env.new_spinner("Creating UI canister".into());
debug!(
env.get_logger(),
"Creating UI canister on the {} network.", network.name
);
Expand Down Expand Up @@ -66,12 +67,14 @@ pub async fn install_ui_canister(
.0
}
};
spinner.set_message("Installing code into UI canister".into());
mgr.install_code(&canister_id, wasm.as_slice())
.with_mode(InstallMode::Install)
.await
.context("Install wasm call failed.")?;
id_store.add(env.get_logger(), UI_CANISTER, &canister_id.to_text(), None)?;
info!(
spinner.finish_and_clear();
debug!(
env.get_logger(),
"The UI canister on the \"{}\" network is \"{}\"",
network.name,
Expand Down

0 comments on commit 9fcb5a3

Please sign in to comment.