Skip to content

Commit

Permalink
Pressing d twice requires q twice to exit (Rigellute#826)
Browse files Browse the repository at this point in the history
* dedup selected device routes from nav stack

* dedup any matching routes from nav stack

* catch duplicate route id on push

* remove return

* remove id from variable name
  • Loading branch information
cobbinma authored Aug 23, 2021
1 parent 67c647a commit eba6390
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,11 +626,18 @@ impl App {
// The navigation_stack actually only controls the large block to the right of `library` and
// `playlists`
pub fn push_navigation_stack(&mut self, next_route_id: RouteId, next_active_block: ActiveBlock) {
self.navigation_stack.push(Route {
id: next_route_id,
active_block: next_active_block,
hovered_block: next_active_block,
});
if !self
.navigation_stack
.last()
.map(|last_route| last_route.id == next_route_id)
.unwrap_or(false)
{
self.navigation_stack.push(Route {
id: next_route_id,
active_block: next_active_block,
hovered_block: next_active_block,
});
}
}

pub fn pop_navigation_stack(&mut self) -> Option<Route> {
Expand Down

0 comments on commit eba6390

Please sign in to comment.