File tree Expand file tree Collapse file tree 4 files changed +18
-12
lines changed
src/renderer/utils/notifications/filters Expand file tree Collapse file tree 4 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -16,15 +16,18 @@ export const reasonFilter: Filter<Reason> = {
16
16
return this . FILTER_TYPES [ reason ] ;
17
17
} ,
18
18
19
- hasFilters ( settings : SettingsState ) {
19
+ hasFilters ( settings : SettingsState ) : boolean {
20
20
return settings . filterReasons . length > 0 ;
21
21
} ,
22
22
23
- isFilterSet ( settings : SettingsState , reason : Reason ) {
23
+ isFilterSet ( settings : SettingsState , reason : Reason ) : boolean {
24
24
return settings . filterReasons . includes ( reason ) ;
25
25
} ,
26
26
27
- getFilterCount ( notifications : AccountNotifications [ ] , reason : Reason ) {
27
+ getFilterCount (
28
+ notifications : AccountNotifications [ ] ,
29
+ reason : Reason ,
30
+ ) : number {
28
31
return notifications . reduce (
29
32
( sum , account ) =>
30
33
sum +
Original file line number Diff line number Diff line change @@ -37,18 +37,18 @@ export const stateFilter: Filter<FilterStateType> = {
37
37
return this . FILTER_TYPES [ stateType ] ;
38
38
} ,
39
39
40
- hasFilters ( settings : SettingsState ) {
40
+ hasFilters ( settings : SettingsState ) : boolean {
41
41
return settings . filterStates . length > 0 ;
42
42
} ,
43
43
44
- isFilterSet ( settings : SettingsState , stateType : FilterStateType ) {
44
+ isFilterSet ( settings : SettingsState , stateType : FilterStateType ) : boolean {
45
45
return settings . filterStates . includes ( stateType ) ;
46
46
} ,
47
47
48
48
getFilterCount (
49
49
notifications : AccountNotifications [ ] ,
50
50
stateType : FilterStateType ,
51
- ) {
51
+ ) : number {
52
52
return notifications . reduce (
53
53
( sum , account ) =>
54
54
sum +
Original file line number Diff line number Diff line change @@ -48,18 +48,18 @@ export const subjectTypeFilter: Filter<SubjectType> = {
48
48
return this . FILTER_TYPES [ subjectType ] ;
49
49
} ,
50
50
51
- hasFilters ( settings : SettingsState ) {
51
+ hasFilters ( settings : SettingsState ) : boolean {
52
52
return settings . filterSubjectTypes . length > 0 ;
53
53
} ,
54
54
55
- isFilterSet ( settings : SettingsState , subjectType : SubjectType ) {
55
+ isFilterSet ( settings : SettingsState , subjectType : SubjectType ) : boolean {
56
56
return settings . filterSubjectTypes . includes ( subjectType ) ;
57
57
} ,
58
58
59
59
getFilterCount (
60
60
notifications : AccountNotifications [ ] ,
61
61
subjectType : SubjectType ,
62
- ) {
62
+ ) : number {
63
63
return notifications . reduce (
64
64
( sum , account ) =>
65
65
sum +
Original file line number Diff line number Diff line change @@ -28,15 +28,18 @@ export const userTypeFilter: Filter<UserType> = {
28
28
return this . FILTER_TYPES [ userType ] ;
29
29
} ,
30
30
31
- hasFilters ( settings : SettingsState ) {
31
+ hasFilters ( settings : SettingsState ) : boolean {
32
32
return settings . filterUserTypes . length > 0 ;
33
33
} ,
34
34
35
- isFilterSet ( settings : SettingsState , userType : UserType ) {
35
+ isFilterSet ( settings : SettingsState , userType : UserType ) : boolean {
36
36
return settings . filterUserTypes . includes ( userType ) ;
37
37
} ,
38
38
39
- getFilterCount ( notifications : AccountNotifications [ ] , userType : UserType ) {
39
+ getFilterCount (
40
+ notifications : AccountNotifications [ ] ,
41
+ userType : UserType ,
42
+ ) : number {
40
43
return notifications . reduce (
41
44
( sum , account ) =>
42
45
sum +
You can’t perform that action at this time.
0 commit comments