Skip to content

Commit

Permalink
Closes #9: Don't make BZ requests if there are no BZ links in page.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcomella committed Jul 30, 2018
1 parent 34f2393 commit 596588e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/ts/features/link_bugzilla_bugs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ namespace FeatureLinkBugzillaBugs {

export async function inject(preDiscussionsContainer: HTMLDivElement) {
const bzLinks = extractBugzillaLinksFromComments();
if (bzLinks.length <= 0) { return; }

const bugNumToLink = getBugNumberToLink(bzLinks);
const bugSummaries = await getBugSummaries(bugNumToLink);

if (bugSummaries.length > 0) {
appendBugzillaDataToContainer(bugSummaries, preDiscussionsContainer);
}
appendBugzillaDataToContainer(bugSummaries, preDiscussionsContainer);
}

function extractBugzillaLinksFromComments(): HTMLAnchorElement[] {
Expand Down

0 comments on commit 596588e

Please sign in to comment.