Fix navigating back to the welcome screen

This commit is contained in:
cketti 2023-11-20 16:36:45 +01:00
parent 9fe2c68cbc
commit 623823dbdc
4 changed files with 5 additions and 12 deletions

View file

@ -24,11 +24,9 @@ fun FeatureNavHost(
) {
onboardingRoute(
onImport = { /* TODO */ },
onBack = navController::popBackStack,
onFinish = { accountUuid ->
) { accountUuid ->
navController.navigateToAccountEditIncomingServerSettings(accountUuid)
},
)
}
accountSetupRoute(
onBack = navController::popBackStack,
onFinish = { accountUuid ->

View file

@ -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) },

View file

@ -30,7 +30,6 @@ private fun NavController.navigateToPermissions() {
@Composable
fun OnboardingNavHost(
onImport: () -> Unit,
onBack: () -> Unit,
onFinish: (String) -> Unit,
hasRuntimePermissions: HasRuntimePermissions = koinInject(),
) {
@ -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()) {

View file

@ -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,
)
}