Skip to content

Commit

Permalink
Merge pull request #7368 from thunderbird/fix_onboarding_navigation
Browse files Browse the repository at this point in the history
Fix onboarding navigation
  • Loading branch information
wmontwe authored Nov 21, 2023
2 parents 1b937d6 + 54608d7 commit f2f6124
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ fun FeatureNavHost(
) {
onboardingRoute(
onImport = { /* TODO */ },
onBack = navController::popBackStack,
onFinish = { accountUuid ->
navController.navigateToAccountEditIncomingServerSettings(accountUuid)
},
)
) { accountUuid ->
navController.navigateToAccountEditIncomingServerSettings(accountUuid)
}
accountSetupRoute(
onBack = navController::popBackStack,
onFinish = { accountUuid ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ internal fun AccountOptionsScreen(
},
bottomBar = {
WizardNavigationBar(
nextButtonText = stringResource(id = string.account_setup_button_finish),
onNextClick = { dispatch(Event.OnNextClicked) },
onBackClick = { dispatch(Event.OnBackClicked) },
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ fun FeatureLauncherNavHost(
) {
onboardingRoute(
onImport = { importSettingsLauncher.launch() },
onBack = onBack,
onFinish = { accountUuid -> accountSetupFinishedLauncher.launch(accountUuid) },
)
) { accountUuid -> accountSetupFinishedLauncher.launch(accountUuid) }
accountSetupRoute(
onBack = onBack,
onFinish = { accountSetupFinishedLauncher.launch(it) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ private fun NavController.navigateToPermissions() {
@Composable
fun OnboardingNavHost(
onImport: () -> Unit,
onBack: () -> Unit,
onFinish: (String) -> Unit,
hasRuntimePermissions: HasRuntimePermissions = koinInject(),
) {
Expand All @@ -50,7 +49,7 @@ fun OnboardingNavHost(

composable(route = NESTED_NAVIGATION_ROUTE_ACCOUNT_SETUP) {
AccountSetupNavHost(
onBack = onBack,
onBack = { navController.popBackStack() },
onFinish = { createdAccountUuid: String ->
accountUuid = createdAccountUuid
if (hasRuntimePermissions()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ fun NavController.navigateToOnboarding(

fun NavGraphBuilder.onboardingRoute(
onImport: () -> Unit,
onBack: () -> Unit,
onFinish: (String) -> Unit,
) {
deepLinkComposable(route = NAVIGATION_ROUTE_ONBOARDING) {
OnboardingNavHost(
onImport = onImport,
onBack = onBack,
onFinish = onFinish,
)
}
Expand Down

0 comments on commit f2f6124

Please sign in to comment.