diff --git a/nextgraph/src/local_broker.rs b/nextgraph/src/local_broker.rs index ac4b0ec..42ac11a 100644 --- a/nextgraph/src/local_broker.rs +++ b/nextgraph/src/local_broker.rs @@ -1306,7 +1306,7 @@ pub async fn user_connect_with_device_info( session.verifier.connected_server_id = Some(server_key); // successful. we can stop here - // load verifier from remote connection (if not RocksDb type) + // load verifier from remote connection (if not RocksDb type, or after import on tauri) if let Err(e) = session.verifier.bootstrap().await { session.verifier.connected_server_id = None; Broker::close_all_connections().await; diff --git a/ng-verifier/src/verifier.rs b/ng-verifier/src/verifier.rs index e1844b5..72417ab 100644 --- a/ng-verifier/src/verifier.rs +++ b/ng-verifier/src/verifier.rs @@ -176,6 +176,10 @@ impl Verifier { self.config.config_type.is_in_memory() } + fn need_bootstrap(&self) -> bool { + self.stores.len() == 0 + } + fn get_arc_block_storage( &self, ) -> Result>, VerifierError> { @@ -942,7 +946,7 @@ impl Verifier { } async fn bootstrap_from_remote(&mut self) -> Result<(), NgError> { - if self.is_in_memory() { + if self.is_in_memory() || self.need_bootstrap() { let broker = BROKER.read().await; let user = self.config.user_priv_key.to_pub(); let remote = self.connected_server_id.to_owned().unwrap();