Skip to content

Commit

Permalink
fixed a popup bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jossse69 committed Sep 3, 2023
1 parent 3562a99 commit b63ba35
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@ impl UI {

pub fn remove_active_popup(&mut self) {
if let Some(active_popup_index) = self.active_popup {
self.popup_windows.remove(active_popup_index);
//set the active popup to previous popup
self.active_popup = self.previous_popup
if active_popup_index < self.popup_windows.len() {
self.popup_windows.swap_remove(active_popup_index);
// Set the active popup to the previous popup aselse we cant return to the previous popup (if there is one)
self.active_popup = self.previous_popup
}
}
}



pub fn remove_popup(&mut self, index: usize) {
Expand Down

0 comments on commit b63ba35

Please sign in to comment.