mirror of
https://github.com/ProtonMail/protoncore_android.git
synced 2026-05-15 09:50:41 +00:00
feat(presentation-compose): Add key parameter for LaunchOnScreenView.
This commit is contained in:
committed by
MargeBot
parent
b4bcae96e2
commit
dafe0286f4
+5
-2
@@ -23,10 +23,13 @@ import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.ui.platform.LocalSavedStateRegistryOwner
|
||||
import me.proton.core.presentation.utils.launchOnScreenView
|
||||
|
||||
/**
|
||||
* @param key The key to use for re-launching the screen view effect.
|
||||
*/
|
||||
@Composable
|
||||
fun LaunchOnScreenView(enqueue: () -> Unit) {
|
||||
fun LaunchOnScreenView(key: Any? = null, enqueue: () -> Unit) {
|
||||
val registryOwner = LocalSavedStateRegistryOwner.current
|
||||
LaunchedEffect(registryOwner) {
|
||||
LaunchedEffect(registryOwner, key) {
|
||||
registryOwner.launchOnScreenView(registryOwner.savedStateRegistry) {
|
||||
enqueue()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user