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

Collapse NavigableCircuitContent functions #433

Merged
merged 1 commit into from
Feb 4, 2023

Conversation

ashdavies
Copy link
Contributor

Now that the features are available in common code, BasicNavigableCircuitContent doesn't serve much purpose besides alternative defaults, which can by their very nature be changed.

@ashdavies
Copy link
Contributor Author

The difference here is only in that the android function calls BackHandler before delegating, whereas, the common function expects the caller to handle the appropriate platform specific back handling.

@ZacSweers ZacSweers merged commit d20b26b into slackhq:main Feb 4, 2023
@ashdavies ashdavies deleted the a/navigableContent branch February 4, 2023 01:01
kierse added a commit that referenced this pull request Feb 27, 2023
### Problem
#433 (part of efforts to improve KMP support) renamed
`BaseNavigableCircuitContent` to `NavigableCircuitContent`, overloading
the existing Android-specific method with the same name. The only
difference between the two method signatures was an additional param in
the android version (related to setting up the `BackHandler`).

As a result of this change existing uses of `NavigableCircuitContent` on
Android started calling the wrong method, bypassing the logic that
configured the system back handler.

### Fix 
Rather than change the Android overload in some way, or require that
Android callers provide the extra parameter (a friction when 99% of uses
will want the default), I opted to move the back handler setup logic
into the Android-specific `rememberCircuitNavigator`, and remove the
Android overload entirely.
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.

2 participants