Fixed issue when trying to add a participant to an existing group (meeting, conversation, etc...)

This commit is contained in:
Sylvain Berfini 2024-12-18 14:20:16 +01:00
parent aad50669c4
commit 3734c8ca90
2 changed files with 7 additions and 1 deletions

View file

@ -121,7 +121,8 @@ class AddParticipantsFragment : GenericAddressPickerFragment() {
viewModel.modelsList.observe(
viewLifecycleOwner
) {
if (!participants.isNullOrEmpty()) {
if (!participants.isNullOrEmpty() && viewModel.isSelectionEmpty()) {
Log.i("$TAG Found participants in arguments and selection is currently empty, adding them")
viewModel.addSelectedParticipants(participants)
}

View file

@ -43,6 +43,11 @@ class AddParticipantsViewModel
switchToMultipleSelectionMode()
}
@UiThread
fun isSelectionEmpty(): Boolean {
return selection.value.orEmpty().isEmpty()
}
@UiThread
fun addSelectedParticipants(participants: Array<String>) {
coreContext.postOnCoreThread { core ->