Skip to content

Commit

Permalink
Merge pull request #1962 from InsertKoinIO/fix_navigation_arguments_cmp
Browse files Browse the repository at this point in the history
Fix CMP NavBackStack argument unboxing
  • Loading branch information
arnaudgiuliani authored Aug 30, 2024
2 parents 46ab29b + 5c09730 commit a74e470
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.koin.core.annotation.KoinInternalApi

@OptIn(KoinInternalApi::class)
fun defaultNavExtras(viewModelStoreOwner: ViewModelStoreOwner): CreationExtras = when {
viewModelStoreOwner is NavBackStackEntry && viewModelStoreOwner.arguments != null -> viewModelStoreOwner.arguments?.toExtras(viewModelStoreOwner) ?: CreationExtras.Empty
viewModelStoreOwner is NavBackStackEntry -> viewModelStoreOwner.defaultViewModelCreationExtras
viewModelStoreOwner is HasDefaultViewModelProviderFactory -> viewModelStoreOwner.defaultViewModelCreationExtras
else -> CreationExtras.Empty
}

0 comments on commit a74e470

Please sign in to comment.