From 4ee571a7bdb443bdc6b742bfbe885acbe0c82ce7 Mon Sep 17 00:00:00 2001 From: zugdev Date: Thu, 5 Dec 2024 14:23:08 -0300 Subject: [PATCH] feat: prefilter on reasons --- src/home/fetch-github/fetch-data.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/home/fetch-github/fetch-data.ts b/src/home/fetch-github/fetch-data.ts index f124e5c..e385c9e 100644 --- a/src/home/fetch-github/fetch-data.ts +++ b/src/home/fetch-github/fetch-data.ts @@ -24,8 +24,14 @@ async function fetchNotifications(): Promise { // Pre-filter notifications by general rules (repo filtering and ignoring CI activity) function preFilterNotifications(notifications: GitHubNotification[]): GitHubNotifications { return notifications.filter((notification) => { - // Ignore CI activity notifications - if (notification.reason === "ci_activity") return false; + // Ignore based on reason + if ( + ["author", "comment", "ci_activity", "invitation", "member_feature_requested", "security_advisory_credit", "state_change", "team_mention"].includes( + notification.reason + ) + ) { + return false; + } // Ignore notifications from repos that are not relevant const repoName = notification.repository.full_name.split("/")[0];