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

terminate-insurance deeplink with no arg #2441

Merged
merged 3 commits into from
Feb 19, 2025

Conversation

panasetskaya
Copy link
Contributor

No description provided.

@panasetskaya panasetskaya requested a review from a team as a code owner February 18, 2025 18:20
@panasetskaya panasetskaya changed the title deeplink with no arg and popBackStack terminate-insurance deeplink with no arg Feb 18, 2025
@@ -83,7 +83,7 @@ private fun ChooseInsuranceToTerminateScreen(
when (uiState) {
ChooseInsuranceToTerminateStepUiState.NotAllowed -> {
HedvigScaffold(
navigateUp = navigateUp,
navigateUp = popBackStack,
Copy link
Member

Choose a reason for hiding this comment

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

Why did we change that here in this pr? 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

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

bc with navigateUp we didn't go back to the previous app if we come from the deeplink on topAppBar icon click, so system back button and topAppBar back icon had different behaviour.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you're right about the link itself being redundant, just default null argument for destination works.

Copy link
Member

@StylianosGakis StylianosGakis Feb 19, 2025

Choose a reason for hiding this comment

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

bc with navigateUp we didn't go back to the previous app if we come from the deeplink on topAppBar icon click, so system back button and topAppBar back icon had different behaviour.

Yeah that is what we want here as per the docs https://developer.android.com/guide/navigation/principles#the_up_button_never_exits_your_app

"""
When your app is launched using a deep link on another app's task, Up transitions users back to your app’s task and through a simulated back stack and not to the app that triggered the deep link. The Back button, however, does take you back to the other app.
"""

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right! What about the "close" textButton etc? In one of the previous pr we put popBackStack there

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, since those are not the "up" button, for those we want to emulate what the back button would do, which is what we do in here

if (!navController.popBackStack()) {
updatedFinishApp()
}

Which is pop the backstack if possible. If not possible it means we're at the top of the backstack so finish the app

@StylianosGakis
Copy link
Member

Actually a question. Would this work if we only added 1 deep link, the one with the ID and the = null change that we did?
Could we test this out perhaps? My understanding of it is that since it's nullable and has a default it should also match the deep link properly.

@panasetskaya panasetskaya merged commit 9f7560a into develop Feb 19, 2025
4 checks passed
@panasetskaya panasetskaya deleted the fix/terminate-contract-deeplink branch February 19, 2025 10:43
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