Skip to content

Commit 9227e85

Browse files
author
PR Batch Tester
committed
fix(client): skip label collisions when accounts are absent
1 parent 606201c commit 9227e85

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

‎packages/client-runtime/src/state/projectGrouping.ts‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,15 +433,19 @@ export function buildProjectGroups<TProject extends EnvironmentProject>(input: {
433433
};
434434
});
435435
const labelCounts = new Map<string, number>();
436-
for (const group of groups) {
437-
const label = group.label.toLowerCase();
438-
labelCounts.set(label, (labelCounts.get(label) ?? 0) + 1);
436+
if (input.repositoryAccounts) {
437+
for (const group of groups) {
438+
const label = group.label.toLowerCase();
439+
labelCounts.set(label, (labelCounts.get(label) ?? 0) + 1);
440+
}
439441
}
440442
return groups.map(({ qualifiedLabel, ...group }) => ({
441443
...group,
442444
// The owner stays when dropping it would make two groups read the same.
443445
label:
444-
group.label !== qualifiedLabel && labelCounts.get(group.label.toLowerCase())! > 1
446+
input.repositoryAccounts &&
447+
group.label !== qualifiedLabel &&
448+
labelCounts.get(group.label.toLowerCase())! > 1
445449
? qualifiedLabel
446450
: group.label,
447451
}));

0 commit comments

Comments
 (0)