Skip to content

Commit

Permalink
fix: do not create self-referencing links
Browse files Browse the repository at this point in the history
Closes #143
  • Loading branch information
nikku committed Nov 30, 2022
1 parent 52f43a5 commit 3599c44
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/app/lib/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ class Store {

createLinks(context, issue) {

const { id } = issue;
const { id, number: issueNumber } = issue;

const repoAndOwner = {
repo: issue.repository.name,
Expand All @@ -482,6 +482,15 @@ class Store {
...linkAttrs
} = link;

// skip self links
if (
owner === repoAndOwner.owner &&
repo === repoAndOwner.repo &&
number === issueNumber
) {
return map;
}

const linkedKey = `${owner}/${repo}#${number}`;

const linkedIssue = context.getIssueByKey(linkedKey);
Expand Down

0 comments on commit 3599c44

Please sign in to comment.