mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 08:39:22 +01:00
Fix crash when entering convo with mention in draft.
This commit is contained in:
@@ -8,6 +8,7 @@ import androidx.fragment.app.activityViewModels
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.ViewModelStoreOwner
|
||||
import androidx.lifecycle.viewmodel.CreationExtras
|
||||
|
||||
/**
|
||||
@@ -42,9 +43,11 @@ inline fun <reified VM : ViewModel> ComponentActivity.viewModel(
|
||||
|
||||
@MainThread
|
||||
inline fun <reified VM : ViewModel> Fragment.viewModel(
|
||||
noinline ownerProducer: () -> ViewModelStoreOwner = { this },
|
||||
noinline create: (CreationExtras) -> VM
|
||||
): Lazy<VM> {
|
||||
return viewModels(
|
||||
ownerProducer = ownerProducer,
|
||||
factoryProducer = ViewModelFactory.factoryProducer(create)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user