diff --git a/src/home/fetch-github/fetch-data.ts b/src/home/fetch-github/fetch-data.ts index 7ecef09..09dbd53 100644 --- a/src/home/fetch-github/fetch-data.ts +++ b/src/home/fetch-github/fetch-data.ts @@ -3,7 +3,7 @@ import { GitHubAggregated, GitHubIssue, GitHubNotification, GitHubNotifications, import { getGitHubAccessToken } from "../getters/get-github-access-token"; import { handleRateLimit } from "./handle-rate-limit"; import { RequestError } from "@octokit/request-error"; -// import { testAllNotifications } from "./test-all-notifications"; +import { testAllNotifications } from "./test-all-notifications"; export const organizationImageCache = new Map(); // this should be declared in image related script @@ -243,14 +243,35 @@ export async function fetchAllNotifications(): Promise { + if (!aggregated.issue || !aggregated.issue.labels) { + return false; + } + + return aggregated.issue.labels.some((label) => { + if (typeof label === "string" || !label.name) { + return false; + } + + const match = label.name.match(/^(Priority): /); + if (match) { + console.log("issue", aggregated.issue.title, "label", label); + return true; + } + + return false; + }); + }); + + for (const aggregated of filteredNotifications) { + // count backlinks const backlinkCount = countBacklinks(aggregated, pullRequests, issues); aggregated.backlinkCount = backlinkCount; } - console.log("allNotifications", allNotifications); - return allNotifications; + console.log("filteredNotifications", filteredNotifications); + return filteredNotifications; }