mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 08:02:28 +00:00
perf: reuse accepted project group IDs for parent validation (#20341)
Co-authored-by: Orca Worker <orca-worker@localhost>
This commit is contained in:
@@ -91,9 +91,8 @@ export function normalizeProjectGroups(value: unknown): ProjectGroup[] {
|
||||
groups.sort(
|
||||
(left, right) => left.tabOrder - right.tabOrder || left.name.localeCompare(right.name)
|
||||
)
|
||||
const groupIds = new Set(groups.map((group) => group.id))
|
||||
for (const group of groups) {
|
||||
if (group.parentGroupId === group.id || !groupIds.has(group.parentGroupId ?? '')) {
|
||||
if (group.parentGroupId === group.id || !seen.has(group.parentGroupId ?? '')) {
|
||||
group.parentGroupId = null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user