manager: Add default groups when empty

This commit is contained in:
weishu
2023-06-04 10:02:49 +08:00
parent 8af5a9038b
commit 11d0029a4b

View File

@@ -164,9 +164,11 @@ fun RootProfileConfig(
) )
}) })
val selectedGroups = profile.groups.mapNotNull { id -> val selectedGroups = profile.groups.ifEmpty { listOf(0) }.let {
it.mapNotNull { id ->
Groups.values().find { it.gid == id } Groups.values().find { it.gid == id }
} }
}
GroupsPanel(selectedGroups) { GroupsPanel(selectedGroups) {
onProfileChange( onProfileChange(
profile.copy( profile.copy(