🐛 fix: prevent duplicate authors from being added when remoteBranch is present but pr is not

This commit is contained in:
Kiril Videlov 2023-12-15 10:42:14 +01:00 committed by Kiril Videlov
parent 0d008ff74b
commit 0938c82793

View File

@ -33,7 +33,7 @@ export class CombinedBranch {
if (this.pr?.author) { if (this.pr?.author) {
authors.push(this.pr.author); authors.push(this.pr.author);
} }
if (this.remoteBranch) { if (this.remoteBranch && !this.pr) {
// TODO: Is there a better way to filter out duplicates? // TODO: Is there a better way to filter out duplicates?
authors.push( authors.push(
...this.remoteBranch.authors.filter((a) => !authors.some((b) => a.email == b.email)) ...this.remoteBranch.authors.filter((a) => !authors.some((b) => a.email == b.email))