1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::imports::*;

#[derive(Default, Handler)]
#[help("Reload the web interface (used for testing)")]
pub struct Reload;

impl Reload {
    async fn main(self: Arc<Self>, ctx: &Arc<dyn Context>, _argv: Vec<String>, _cmd: &str) -> Result<()> {
        // #[cfg(target_arch = "wasm32")]
        // workflow_dom::utils::window().location().reload().ok();

        let ctx = ctx.clone().downcast_arc::<KaspaCli>()?;
        tprintln!(ctx, "{}", style("reloading wallet ...").magenta());
        ctx.wallet().reload(true).await?;

        Ok(())
    }
}