manager: Add default groups when empty

This commit is contained in:
weishu
2023-06-04 10:02:49 +08:00
parent 9abe9687ab
commit 42a4a00f76

View File

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