ui: fix wallet deletion, node info max peers amount, paddings at logo and wallet recovery settings

This commit is contained in:
ardocrat
2024-05-30 22:46:59 +03:00
parent b78ba0bfb5
commit 538ff37056
6 changed files with 34 additions and 23 deletions
+10 -10
View File
@@ -89,16 +89,16 @@ impl WalletList {
list.insert(0, wallet);
}
// /// Remove [`Wallet`] with provided identifier.
// pub fn remove(&mut self, id: i64) {
// let list = self.mut_list();
// for (index, wallet) in list.iter().enumerate() {
// if wallet.get_config().id == id {
// list.remove(index);
// return;
// }
// }
// }
/// Remove [`Wallet`] with provided identifier.
pub fn remove(&mut self, id: i64) {
let list = self.mut_list();
for (index, wallet) in list.iter().enumerate() {
if wallet.get_config().id == id {
list.remove(index);
return;
}
}
}
/// Select [`Wallet`] with provided identifier.
pub fn select(&mut self, id: Option<i64>) {
+6 -4
View File
@@ -1018,19 +1018,21 @@ impl Wallet {
/// Close the wallet, delete its files and mark it as deleted.
pub fn delete_wallet(&self) {
let wallet_delete = self.clone();
// Close wallet if open.
if self.is_open() {
self.close();
}
// Mark wallet as deleted.
let wallet_delete = self.clone();
wallet_delete.deleted.store(true, Ordering::Relaxed);
thread::spawn(move || {
// Wait wallet to be closed.
if wallet_delete.is_open() {
thread::sleep(Duration::from_millis(300));
thread::sleep(Duration::from_millis(100));
}
// Remove wallet files.
let _ = fs::remove_dir_all(wallet_delete.get_config().get_data_path());
// Mark wallet as not opened and deleted.
// Mark wallet as deleted.
wallet_delete.deleted.store(true, Ordering::Relaxed);
// Start sync to close thread.
wallet_delete.sync(true);