From 774cbc15f68213001d526807f023428315f845fb Mon Sep 17 00:00:00 2001 From: DevSrSouza Date: Tue, 28 Nov 2023 18:37:46 -0300 Subject: [PATCH] fix compilation after ScreenLifecycleStore changes --- .../cafe/adriel/voyager/androidx/AndroidScreenLifecycleOwner.kt | 2 +- .../cafe/adriel/voyager/core/lifecycle/ScreenLifecycleStore.kt | 2 +- .../kotlin/cafe/adriel/voyager/kodein/ScreenLifecycleScope.kt | 2 +- .../kotlin/cafe/adriel/voyager/core/model/ScreenModel.kt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/voyager-core/src/androidMain/kotlin/cafe/adriel/voyager/androidx/AndroidScreenLifecycleOwner.kt b/voyager-core/src/androidMain/kotlin/cafe/adriel/voyager/androidx/AndroidScreenLifecycleOwner.kt index a743e8ca..a24d35b8 100644 --- a/voyager-core/src/androidMain/kotlin/cafe/adriel/voyager/androidx/AndroidScreenLifecycleOwner.kt +++ b/voyager-core/src/androidMain/kotlin/cafe/adriel/voyager/androidx/AndroidScreenLifecycleOwner.kt @@ -242,7 +242,7 @@ public class AndroidScreenLifecycleOwner private constructor() : Lifecycle.Event.ON_DESTROY ) public fun get(screen: Screen): ScreenLifecycleOwner { - return ScreenLifecycleStore.register(screen) { AndroidScreenLifecycleOwner() } + return ScreenLifecycleStore.get(screen) { AndroidScreenLifecycleOwner() } } } } diff --git a/voyager-core/src/commonMain/kotlin/cafe/adriel/voyager/core/lifecycle/ScreenLifecycleStore.kt b/voyager-core/src/commonMain/kotlin/cafe/adriel/voyager/core/lifecycle/ScreenLifecycleStore.kt index f43e5dee..4f0be0ad 100644 --- a/voyager-core/src/commonMain/kotlin/cafe/adriel/voyager/core/lifecycle/ScreenLifecycleStore.kt +++ b/voyager-core/src/commonMain/kotlin/cafe/adriel/voyager/core/lifecycle/ScreenLifecycleStore.kt @@ -31,7 +31,7 @@ public object ScreenLifecycleStore { @Deprecated( message = "Use `get` instead. Will be removed in 1.1.0.", replaceWith = ReplaceWith("ScreenLifecycleStore.get(screen, factory)"), - level = DeprecationLevel.HIDDEN, + level = DeprecationLevel.HIDDEN ) public inline fun register( screen: Screen, diff --git a/voyager-kodein/src/commonMain/kotlin/cafe/adriel/voyager/kodein/ScreenLifecycleScope.kt b/voyager-kodein/src/commonMain/kotlin/cafe/adriel/voyager/kodein/ScreenLifecycleScope.kt index dd30cbd1..a54a8f19 100644 --- a/voyager-kodein/src/commonMain/kotlin/cafe/adriel/voyager/kodein/ScreenLifecycleScope.kt +++ b/voyager-kodein/src/commonMain/kotlin/cafe/adriel/voyager/kodein/ScreenLifecycleScope.kt @@ -28,7 +28,7 @@ public class ScreenContext( internal var disposeCallback: () -> Unit = {} internal fun onRegistryScope() { - ScreenLifecycleStore.register(screen) { + ScreenLifecycleStore.get(screen) { ScreenScopeLifecycleOwner(disposeCallback) } } diff --git a/voyager-screenmodel/src/commonMain/kotlin/cafe/adriel/voyager/core/model/ScreenModel.kt b/voyager-screenmodel/src/commonMain/kotlin/cafe/adriel/voyager/core/model/ScreenModel.kt index f37d1f64..e42d0839 100644 --- a/voyager-screenmodel/src/commonMain/kotlin/cafe/adriel/voyager/core/model/ScreenModel.kt +++ b/voyager-screenmodel/src/commonMain/kotlin/cafe/adriel/voyager/core/model/ScreenModel.kt @@ -28,7 +28,7 @@ public inline fun Screen.rememberScreenModel( crossinline factory: @DisallowComposableCalls () -> T ): T { val screenModelStore = remember(this) { - ScreenLifecycleStore.register(this) { ScreenModelStore } + ScreenLifecycleStore.get(this) { ScreenModelStore } } return remember(screenModelStore.getKey(this, tag)) { screenModelStore.getOrPut(this, tag, factory)