kaspa_cli_lib/modules/
reload.rs

1use crate::imports::*;
2
3#[derive(Default, Handler)]
4#[help("Reload the web interface (used for testing)")]
5pub struct Reload;
6
7impl Reload {
8    async fn main(self: Arc<Self>, ctx: &Arc<dyn Context>, _argv: Vec<String>, _cmd: &str) -> Result<()> {
9        // #[cfg(target_arch = "wasm32")]
10        // workflow_dom::utils::window().location().reload().ok();
11
12        let ctx = ctx.clone().downcast_arc::<KaspaCli>()?;
13
14        let guard = ctx.wallet().guard();
15        let guard = guard.lock().await;
16
17        tprintln!(ctx, "{}", style("reloading wallet ...").magenta());
18        ctx.wallet().reload(true, &guard).await?;
19
20        Ok(())
21    }
22}