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,8 +164,10 @@ fun RootProfileConfig(
) )
}) })
val selectedGroups = profile.groups.mapNotNull { id -> val selectedGroups = profile.groups.ifEmpty { listOf(0) }.let {
Groups.values().find { it.gid == id } it.mapNotNull { id ->
Groups.values().find { it.gid == id }
}
} }
GroupsPanel(selectedGroups) { GroupsPanel(selectedGroups) {
onProfileChange( onProfileChange(