Skip to content

Commit

Permalink
fix: parcelableNavigatorSaver compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
DevSrSouza committed May 7, 2023
1 parent f3f727e commit 5e8f431
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Any> = NavigatorSaver { _, stateHolder, disposeBehavior, parent ->
public fun parcelableNavigatorSaver(): NavigatorSaver<Any> = NavigatorSaver { _, key, stateHolder, disposeBehavior, parent ->
listSaver(
save = { navigator ->
val screenAsParcelables = navigator.items.filterIsInstance<Parcelable>()
Expand All @@ -23,7 +23,7 @@ public fun parcelableNavigatorSaver(): NavigatorSaver<Any> = NavigatorSaver { _,

screenAsParcelables
},
restore = { items -> Navigator(items as List<Screen>, stateHolder, disposeBehavior, parent) }
restore = { items -> Navigator(items as List<Screen>, key, stateHolder, disposeBehavior, parent) }
)
}

Expand Down

0 comments on commit 5e8f431

Please sign in to comment.