fix: opened file data providing

This commit is contained in:
ardocrat 2024-10-07 19:45:29 +03:00
parent bed041a1c3
commit 7e6954afd9

View file

@ -304,23 +304,16 @@ impl WalletsContent {
if !Content::is_dual_panel_mode(ui) && Content::is_network_panel_open() { if !Content::is_dual_panel_mode(ui) && Content::is_network_panel_open() {
Content::toggle_network_panel(); Content::toggle_network_panel();
} }
// Pass data to opened selected wallet or show wallets selection. // Pass data to single wallet or show wallets selection.
if self.wallet_content.is_some() { if wallets_size == 1 {
if self.showing_wallet() { let w = self.wallets.list()[0].clone();
if wallets_size == 1 { if w.is_open() {
let wallet_content = self.wallet_content.as_mut().unwrap(); self.wallet_content = Some(WalletContent::new(w, data));
wallet_content.on_data(data);
} else {
self.show_wallet_selection_modal(data);
}
} else { } else {
if wallets_size == 1 { self.show_opening_modal(w, data, cb);
let wallet_content = self.wallet_content.as_ref().unwrap();
self.show_opening_modal(wallet_content.wallet.clone(), data, cb);
} else {
self.show_wallet_selection_modal(data);
}
} }
} else {
self.show_wallet_selection_modal(data);
} }
} }