Fix behavior of back button when adding additional accounts
This commit is contained in:
parent
3702eaee02
commit
41435cb7f6
2 changed files with 6 additions and 1 deletions
|
@ -16,6 +16,7 @@ import org.koin.compose.koinInject
|
||||||
fun FeatureLauncherNavHost(
|
fun FeatureLauncherNavHost(
|
||||||
navController: NavHostController,
|
navController: NavHostController,
|
||||||
startDestination: String?,
|
startDestination: String?,
|
||||||
|
onBack: () -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
importSettingsLauncher: ImportSettingsLauncher = koinInject(),
|
importSettingsLauncher: ImportSettingsLauncher = koinInject(),
|
||||||
accountSetupFinishedLauncher: AccountSetupFinishedLauncher = koinInject(),
|
accountSetupFinishedLauncher: AccountSetupFinishedLauncher = koinInject(),
|
||||||
|
@ -30,7 +31,7 @@ fun FeatureLauncherNavHost(
|
||||||
onImport = { importSettingsLauncher.launch() },
|
onImport = { importSettingsLauncher.launch() },
|
||||||
)
|
)
|
||||||
accountSetupRoute(
|
accountSetupRoute(
|
||||||
onBack = navController::popBackStack,
|
onBack = onBack,
|
||||||
onFinish = { accountSetupFinishedLauncher.launch(it) },
|
onFinish = { accountSetupFinishedLauncher.launch(it) },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.safeDrawingPadding
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.navigation.compose.rememberNavController
|
import androidx.navigation.compose.rememberNavController
|
||||||
|
import app.k9mail.core.ui.compose.common.activity.LocalActivity
|
||||||
import app.k9mail.core.ui.compose.designsystem.atom.Background
|
import app.k9mail.core.ui.compose.designsystem.atom.Background
|
||||||
import app.k9mail.core.ui.compose.theme.K9Theme
|
import app.k9mail.core.ui.compose.theme.K9Theme
|
||||||
import app.k9mail.feature.launcher.navigation.FeatureLauncherNavHost
|
import app.k9mail.feature.launcher.navigation.FeatureLauncherNavHost
|
||||||
|
@ -23,9 +24,12 @@ fun FeatureLauncherApp(
|
||||||
.safeDrawingPadding()
|
.safeDrawingPadding()
|
||||||
.then(modifier),
|
.then(modifier),
|
||||||
) {
|
) {
|
||||||
|
val activity = LocalActivity.current
|
||||||
|
|
||||||
FeatureLauncherNavHost(
|
FeatureLauncherNavHost(
|
||||||
navController = navController,
|
navController = navController,
|
||||||
startDestination = startDestination,
|
startDestination = startDestination,
|
||||||
|
onBack = { activity.finish() },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue