mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Prevent use of const friend in contact editor
This commit is contained in:
parent
fbed7f4f74
commit
f3178a0854
1 changed files with 4 additions and 2 deletions
|
|
@ -30,6 +30,7 @@ import androidx.core.content.FileProvider
|
|||
import androidx.lifecycle.lifecycleScope
|
||||
import java.io.File
|
||||
import kotlinx.coroutines.launch
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.R
|
||||
import org.linphone.activities.GenericFragment
|
||||
|
|
@ -55,8 +56,9 @@ class ContactEditorFragment : GenericFragment<ContactEditorFragmentBinding>(), S
|
|||
binding.lifecycleOwner = viewLifecycleOwner
|
||||
|
||||
val contact = sharedViewModel.selectedContact.value
|
||||
// TODO: FIXME: contact can be const! Find a way to get it not-const!
|
||||
data = ContactEditorData(contact)
|
||||
val contactRefKey = contact?.refKey
|
||||
val friend = if (contactRefKey != null) coreContext.core.getFriendByRefKey(contactRefKey) else null
|
||||
data = ContactEditorData(friend ?: contact)
|
||||
binding.viewModel = data
|
||||
|
||||
useMaterialSharedAxisXForwardAnimation = sharedViewModel.isSlidingPaneSlideable.value == false
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue