Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add spinner for Candid UI canister creation #4094

Merged
merged 3 commits into from
Feb 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading