Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pressing d twice requires q twice to exit #826

Merged
merged 5 commits into from
Aug 23, 2021
Merged

Pressing d twice requires q twice to exit #826

merged 5 commits into from
Aug 23, 2021

Conversation

cobbinma
Copy link
Contributor

@cobbinma cobbinma commented Jun 1, 2021

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 d more than once.
To get back to the main menu, each of these needs to be closed separately by pressing q the same number of times.

It would be nicer if pressing q only once always goes back to the main menu.

E.g, actual behavior:

press d
press d
press q
You're seeing the device selector
expected behavior:

press d
press d
press q
You're seeing the main menu

src/app.rs Outdated
@@ -634,6 +634,8 @@ impl App {
}

pub fn pop_navigation_stack(&mut self) -> Option<Route> {
self.navigation_stack.dedup_by(|a, b| a.id == b.id);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for looking at this 👍 moved to push_navigation_stack and changed to if statement.

Copy link
Owner

@Rigellute Rigellute left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks good!

Thank you 👏

@Rigellute Rigellute merged commit eba6390 into Rigellute:master Aug 23, 2021
@Rigellute
Copy link
Owner

@all-contributors please add @cobbinma for code

@allcontributors
Copy link
Contributor

@Rigellute

I've put up a pull request to add @cobbinma! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pressing d twice requires q twice to exit
3 participants