Skip to content
Snippets Groups Projects
Commit 0930d80f authored by Sebastian's avatar Sebastian
Browse files

Don't display no contacts screen when search returns no results

parent f8809f50
No related branches found
No related tags found
1 merge request!108Don't display no contacts screen when search returns no results
Pipeline #9255 passed
......@@ -43,6 +43,10 @@ abstract class ContactsViewModel(
private val _fullContactList = mutableStateListOf<BaseContactItem>()
val noContactsYet = derivedStateOf {
_fullContactList.isEmpty()
}
val contactList = derivedStateOf {
_fullContactList.filter(::filterContactItem).sortedByDescending { it.timestamp }
}
......
......@@ -46,7 +46,7 @@ fun PrivateMessageScreen(
var isContactDialogVisible by remember { mutableStateOf(false) }
if (isContactDialogVisible) AddContactDialog(onClose = { isContactDialogVisible = false })
if (viewModel.contactList.value.isEmpty()) {
if (viewModel.noContactsYet.value) {
NoContactsYet(onContactAdd = { isContactDialogVisible = true })
return
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment