Skip to content

Commit

Permalink
use Koin KMP tool for Class name
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudgiuliani committed May 15, 2024
1 parent 084eb21 commit 4f7fc12
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import org.koin.core.parameter.ParametersDefinition
import org.koin.core.parameter.ParametersHolder
import org.koin.core.qualifier.Qualifier
import org.koin.core.scope.Scope
import org.koin.mp.KoinPlatformTools
import kotlin.reflect.KClass

@KoinInternalApi
Expand All @@ -42,7 +43,7 @@ fun <T : ViewModel> resolveViewModel(
): T {
val factory = KoinViewModelFactory(vmClass, scope, qualifier, parameters)
val provider = ViewModelProvider.create(viewModelStore, factory, extras)
val vmKey = getViewModelKey(qualifier, key, vmClass.qualifiedName)
val vmKey = getViewModelKey(qualifier, key, KoinPlatformTools.getClassName(vmClass))
return when {
vmKey != null -> provider[vmKey, vmClass]
else -> provider[vmClass]
Expand Down

0 comments on commit 4f7fc12

Please sign in to comment.