Pressing d twice requires q twice to exit#826
Merged
Conversation
| } | ||
|
|
||
| pub fn pop_navigation_stack(&mut self) -> Option<Route> { | ||
| self.navigation_stack.dedup_by(|a, b| a.id == b.id); |
There was a problem hiding this comment.
I think it would be just a bit nicer to do this in push_navigation_stack, assuming that that is the only place where the stack is stack is grown. In that case, it could possibly be just an if statement checking whether the current id is the same as the id at the top of the stack.
Contributor
Author
There was a problem hiding this comment.
thanks for looking at this 👍 moved to push_navigation_stack and changed to if statement.
Rigellute
approved these changes
Aug 23, 2021
Owner
Rigellute
left a comment
There was a problem hiding this comment.
Nice, looks good!
Thank you 👏
Owner
|
@all-contributors please add @cobbinma for code |
Contributor
|
I've put up a pull request to add @cobbinma! 🎉 |
nighi
pushed a commit
to nighi/spotify-tui
that referenced
this pull request
Jul 11, 2025
* 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi guys 👋,
First attempt at a PR here and attempted to resolve issue
Did this by
deduping any routes on the navigation stack with matching ids.The device selector popup can be opened multiple times by pressing
dmore than once.To get back to the main menu, each of these needs to be closed separately by pressing
qthe same number of times.It would be nicer if pressing
qonly once always goes back to the main menu.E.g, actual behavior:
press
dpress
dpress
qYou're seeing the device selector
expected behavior:
press
dpress
dpress
qYou're seeing the main menu