Pin: use moveTaskToBack instead of finish

This commit is contained in:
ganfra
2023-10-11 20:25:51 +02:00
parent a2ebf39cb5
commit 45feedb208
2 changed files with 3 additions and 3 deletions

View File

@@ -48,7 +48,7 @@ fun <T : Any> BackStack<T>.removeLast(element: T) {
}
@Composable
fun FinishActivityBackHandler(enabled: Boolean = true) {
fun MoveActivityToBackgroundBackHandler(enabled: Boolean = true) {
fun Context.findActivity(): ComponentActivity? = when (this) {
is ComponentActivity -> this
@@ -58,7 +58,7 @@ fun FinishActivityBackHandler(enabled: Boolean = true) {
val context = LocalContext.current
BackHandler(enabled = enabled) {
context.findActivity()?.finish()
context.findActivity()?.moveTaskToBack(false)
}
}

View File

@@ -351,7 +351,7 @@ class LoggedInFlowNode @AssistedInject constructor(
}
}
PinState.Locked -> {
FinishActivityBackHandler()
MoveActivityToBackgroundBackHandler()
PermanentChild(permanentNavModel = permanentNavModel, navTarget = NavTarget.LockPermanent)
}
}