mirror of
https://github.com/twofas/2fas-android.git
synced 2024-11-22 02:09:58 +01:00
Fix default group expand state
This commit is contained in:
parent
a64820fc99
commit
1cbb009254
@ -62,10 +62,14 @@ internal class GroupsLocalSource(
|
||||
|
||||
fun deleteGroup(id: String) {
|
||||
val local = getGroups()
|
||||
val newList = local.list.filterNot { it.id == id }
|
||||
|
||||
preferences.putString(
|
||||
KeyGroups, json.encodeToString(
|
||||
local.copy(list = local.list.filterNot { it.id == id })
|
||||
local.copy(
|
||||
list = newList,
|
||||
isDefaultGroupExpanded = if (newList.isEmpty()) true else local.isDefaultGroupExpanded
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ internal class ServicesViewModel(
|
||||
}
|
||||
}
|
||||
|
||||
if (group.isExpanded || result.isInEditMode) {
|
||||
if (group.isExpanded || result.isInEditMode || groupedServices.size == 1) {
|
||||
services.forEach { service ->
|
||||
add(ServicesListItem.ServiceItem(service))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user