Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

Commit

Permalink
Wait for idb to save after changing password
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyRonning committed Jul 7, 2023
1 parent ce80f9b commit 8522a99
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mutiny-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ pub use crate::gossip::{GOSSIP_SYNC_TIME_KEY, NETWORK_GRAPH_KEY, PROB_SCORER_KEY
pub use crate::keymanager::generate_seed;
pub use crate::ldkstorage::{CHANNEL_MANAGER_KEY, MONITORS_PREFIX_KEY};

use crate::nostr::NostrManager;
use crate::storage::MutinyStorage;
use crate::{error::MutinyError, nostr::ReservedProfile};
use crate::{nodemanager::NodeManager, nostr::ProfileType};
use crate::{nostr::NostrManager, utils::sleep};
use ::nostr::Kind;
use bip39::Mnemonic;
use bitcoin::secp256k1::PublicKey;
Expand Down Expand Up @@ -329,9 +329,11 @@ impl<S: MutinyStorage> MutinyWallet<S> {
new.filter(|s| !s.is_empty()),
)?;

self.storage.stop();

self.start().await?;
// There's not a good way to check that all the indexeddb
// data is saved in the background. This should get better
// once we have async saving, but for now just make sure
// the user has saved their seed already.
sleep(5_000).await;

Ok(())
}
Expand Down

0 comments on commit 8522a99

Please sign in to comment.