From 5e8f431b3b5bd54d9a11f737dc5c32d4c424e8f2 Mon Sep 17 00:00:00 2001 From: DevSrSouza Date: Sun, 7 May 2023 17:08:39 -0300 Subject: [PATCH] fix: parcelableNavigatorSaver compilation --- .../cafe/adriel/voyager/navigator/NavigatorSaver.android.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/voyager-navigator/src/androidMain/kotlin/cafe/adriel/voyager/navigator/NavigatorSaver.android.kt b/voyager-navigator/src/androidMain/kotlin/cafe/adriel/voyager/navigator/NavigatorSaver.android.kt index 9b3526db..65b710d0 100644 --- a/voyager-navigator/src/androidMain/kotlin/cafe/adriel/voyager/navigator/NavigatorSaver.android.kt +++ b/voyager-navigator/src/androidMain/kotlin/cafe/adriel/voyager/navigator/NavigatorSaver.android.kt @@ -8,7 +8,7 @@ import cafe.adriel.voyager.core.screen.Screen * Navigator Saver that forces all Screens be [Parcelable], if not, it will throw a exception while trying to save * the navigator state. */ -public fun parcelableNavigatorSaver(): NavigatorSaver = NavigatorSaver { _, stateHolder, disposeBehavior, parent -> +public fun parcelableNavigatorSaver(): NavigatorSaver = NavigatorSaver { _, key, stateHolder, disposeBehavior, parent -> listSaver( save = { navigator -> val screenAsParcelables = navigator.items.filterIsInstance() @@ -23,7 +23,7 @@ public fun parcelableNavigatorSaver(): NavigatorSaver = NavigatorSaver { _, screenAsParcelables }, - restore = { items -> Navigator(items as List, stateHolder, disposeBehavior, parent) } + restore = { items -> Navigator(items as List, key, stateHolder, disposeBehavior, parent) } ) }