From e4796e66b17728993225de5b72b9aca88fdc77f8 Mon Sep 17 00:00:00 2001 From: Niko PLP Date: Fri, 5 Apr 2024 13:55:53 +0300 Subject: [PATCH] documentation --- nextgraph/src/local_broker.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nextgraph/src/local_broker.rs b/nextgraph/src/local_broker.rs index c0788f2..07e502f 100644 --- a/nextgraph/src/local_broker.rs +++ b/nextgraph/src/local_broker.rs @@ -458,7 +458,11 @@ pub async fn wallet_import( wallet_was_opened(opened_wallet).await } -/// Must be called after [wallet_open_with_pazzle_words] if you are not importing +/// Must be called after [wallet_open_with_pazzle_words] if you are not importing. +/// +/// this is a separate step because in JS webapp, the opening of a wallet takes time and freezes the GUI. +/// We need to run it in the background in a WebWorker. but there, the LocalBroker cannot access localStorage... +/// So a separate function must be called, once the WebWorker is done. pub async fn wallet_was_opened(mut wallet: SensitiveWallet) -> Result { let mut broker = match LOCAL_BROKER.get() { None | Some(Err(_)) => return Err(NgError::LocalBrokerNotInitialized),