File tree Expand file tree Collapse file tree 4 files changed +243
-74
lines changed
Expand file tree Collapse file tree 4 files changed +243
-74
lines changed Original file line number Diff line number Diff line change @@ -69,13 +69,8 @@ export function filterDetailedNotifications(
6969 ) ;
7070 }
7171
72- if ( stateFilter . hasFilters ( settings ) ) {
73- passesFilters =
74- passesFilters &&
75- settings . filterStates . some ( ( state ) =>
76- stateFilter . filterNotification ( notification , state ) ,
77- ) ;
78- }
72+ passesFilters =
73+ passesFilters && isNotificationStateVisible ( notification , settings ) ;
7974 }
8075
8176 return passesFilters ;
@@ -92,3 +87,16 @@ export function hasAnyFiltersSet(settings: SettingsState): boolean {
9287 reasonFilter . hasFilters ( settings )
9388 ) ;
9489}
90+
91+ export function isNotificationStateVisible (
92+ notification : Notification ,
93+ settings : SettingsState ,
94+ ) : boolean {
95+ if ( stateFilter . hasFilters ( settings ) ) {
96+ return settings . filterStates . some ( ( state ) =>
97+ stateFilter . filterNotification ( notification , state ) ,
98+ ) ;
99+ }
100+
101+ return true ;
102+ }
Original file line number Diff line number Diff line change @@ -108,7 +108,10 @@ export async function enrichNotifications(
108108 let additionalSubjectDetails : GitifySubject = { } ;
109109
110110 try {
111- additionalSubjectDetails = await getGitifySubjectDetails ( notification ) ;
111+ additionalSubjectDetails = await getGitifySubjectDetails (
112+ notification ,
113+ settings ,
114+ ) ;
112115 } catch ( err ) {
113116 logError (
114117 'enrichNotifications' ,
You can’t perform that action at this time.
0 commit comments