mirror of
https://github.com/twofas/2fas-android.git
synced 2024-11-22 02:09:58 +01:00
Fix default group disappearing when empty
This commit is contained in:
parent
5c6a149b03
commit
bc72864377
@ -111,18 +111,13 @@ internal class ServicesViewModel(
|
||||
groupedServices.forEach { (group, services) ->
|
||||
|
||||
if (groupedServices.size > 1) {
|
||||
if (group.id != null || services.isNotEmpty() || result.searchQuery.isNotEmpty()) {
|
||||
val localGroup = result.groups.first { it.id == group.id }
|
||||
add(
|
||||
ServicesListItem.GroupItem(
|
||||
if (result.searchQuery.isNotEmpty()) {
|
||||
localGroup.copy(isExpanded = true)
|
||||
} else {
|
||||
localGroup
|
||||
}
|
||||
add(
|
||||
ServicesListItem.GroupItem(
|
||||
group = group.copy(
|
||||
isExpanded = if (result.searchQuery.isNotEmpty()) true else group.isExpanded
|
||||
)
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
if (group.isExpanded || result.isInEditMode || groupedServices.size == 1 || result.searchQuery.isNotEmpty()) {
|
||||
|
Loading…
Reference in New Issue
Block a user