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

Pop from back stack when Settings back arrow is pressed #125

Merged
merged 4 commits into from
Mar 4, 2024

Conversation

temcguir
Copy link
Collaborator

@temcguir temcguir commented Feb 29, 2024

When the back arrow is pressed on SettingsScreen, navController.navigate(PREVIEW_ROUTE) was being called, which added SettingsScreen to the back stack. Instead, navController.popBackStack() can be used to return to the previous screen, mimicking the behavior of using the device's back button (or back gesture).

@temcguir temcguir linked an issue Feb 29, 2024 that may be closed by this pull request
@Kimblebee
Copy link
Collaborator

taking a look at this, I had intentionally changed it from using navcontroller.popBackStack() way back in #28

"Fix crashing bug that occurs when attempting to navigate back to the preview screen after using a quick setting that rebinds use cases"

@temcguir
Copy link
Collaborator Author

taking a look at this, I had intentionally changed it from using navcontroller.popBackStack() way back in #28

"Fix crashing bug that occurs when attempting to navigate back to the preview screen after using a quick setting that rebinds use cases"

Thanks for the context. I think the old behavior (popBackStack()) is what we actually want. Do you have repro steps for the old bug? It could be that the cause of the bug was actually fixed since #28.

@Kimblebee
Copy link
Collaborator

Thanks for the context. I think the old behavior (popBackStack()) is what we actually want. Do you have repro steps for the old bug? It could be that the cause of the bug was actually fixed since #28.

Yes, my repro steps for the old bug were:

  • Open App
  • Flip camera (using flip camera button on preview or quick settings screen. Or just any option that rebinds use cases)
  • navigate to settings screen
  • navigate back to preview

But it seems like the issue has been solved here now! I'm going to poke around some more, but i think this change should be good to go :) Unfortunately at the moment I'm not entirely sure which change has solved this issue.

@temcguir temcguir merged commit 6c9df56 into main Mar 4, 2024
4 checks passed
@temcguir temcguir deleted the temcguir/back_from_settings branch March 4, 2024 21:10
temcguir added a commit that referenced this pull request Mar 6, 2024
 This somehow didn't make it into #125, even though a test
 was written that depended on it
temcguir added a commit that referenced this pull request Mar 6, 2024
This somehow didn't make it into #125, even though a test
 was written that depended on it
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.

Navigating back from PreviewScreen sometimes returns to settings
2 participants