Merge #1787: fix: missing closing tabs with wallet loading

88966c2b09d3025f730e648c523e7caa0e6487c9 fix: move focused_tab if >= removed index (edouardparis)
a242834bffcea459932d5c8269120fb6bb3a584a fix: missing closing tabs with wallet loading (edouardparis)

Pull request description:

ACKs for top commit:
  pythcoiner:
    tACK 88966c2b, it fixes the second issue

Tree-SHA512: f1b661c767984157cee63e7b458f4041741e326d7dd98a9bf78b6c2262c89981c3d7b62d2433b653a62e6438bc71007392a1a622e0ba9231cb209daadc0b5c34
This commit is contained in:
edouardparis 2025-07-24 11:17:34 +02:00
commit 8c06168d0d
No known key found for this signature in database
GPG Key ID: E65F7A089C20DC8F
2 changed files with 12 additions and 12 deletions

View File

@ -239,12 +239,14 @@ impl GUI {
.iter()
.enumerate()
.filter_map(|(i, tab)| {
if let tab::State::App(a) = &tab.state {
if a.wallet_id() == *wallet_id {
Some(i)
} else {
None
if match &tab.state {
tab::State::App(a) => a.wallet_id() == *wallet_id,
tab::State::Loader(l) => {
l.wallet_settings.wallet_id() == *wallet_id
}
_ => false,
} {
Some(i)
} else {
None
}

View File

@ -71,13 +71,11 @@ impl Pane {
return None;
}
let tab = self.tabs.remove(i);
self.focused_tab = if self.tabs.is_empty() {
0
} else if i < self.tabs.len() - 1 {
i
} else {
self.tabs.len() - 1
};
if self.focused_tab >= i {
self.focused_tab = self.focused_tab.saturating_sub(1);
}
Some(tab)
}