File tree Expand file tree Collapse file tree 3 files changed +16
-13
lines changed
src/renderer/utils/notifications/handlers Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -16,15 +16,19 @@ export class DefaultHandler implements NotificationTypeHandler {
1616 return null ;
1717 }
1818
19- async enrich ( _fetchedData ?: unknown ) : Promise < GitifySubject > {
19+ async fetchAndEnrich (
20+ _notification : Notification ,
21+ _settings : SettingsState ,
22+ ) : Promise < GitifySubject > {
2023 return null ;
2124 }
2225
23- async fetchAndEnrich (
24- notification : Notification ,
25- settings : SettingsState ,
26+ async enrich (
27+ _notification : Notification ,
28+ _settings : SettingsState ,
29+ _fetchedData ?: unknown ,
2630 ) : Promise < GitifySubject > {
27- return this . enrich ( notification , settings , undefined ) ;
31+ return null ;
2832 }
2933
3034 iconType ( _subject : Subject ) : FC < OcticonProps > | null {
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import type {
1616} from '../../../types' ;
1717import { IconColor } from '../../../types' ;
1818import type { Notification , Subject } from '../../../typesGitHub' ;
19- import { fetchIssueByNumber } from '../../api/client' ;
2019import type { IssueDetailsFragment } from '../../api/graphql/generated/graphql' ;
2120import { DefaultHandler , defaultHandler } from './default' ;
2221import { getNotificationAuthor } from './utils' ;
@@ -25,7 +24,7 @@ class IssueHandler extends DefaultHandler {
2524 readonly type = 'Issue' ;
2625
2726 async enrich (
28- notification : Notification ,
27+ _notification : Notification ,
2928 _settings : SettingsState ,
3029 fetchedData ?: IssueDetailsFragment ,
3130 ) : Promise < GitifySubject > {
Original file line number Diff line number Diff line change @@ -11,20 +11,20 @@ export interface NotificationTypeHandler<TFragment = unknown> {
1111 query ( notification : Notification ) : { query ; variables } | null ;
1212
1313 /**
14- * Enrich a notification. Settings may be unused for some handlers .
14+ * Fetch remote data (if needed) and enrich a notification .
1515 */
16- enrich (
16+ fetchAndEnrich (
1717 notification : Notification ,
1818 settings : SettingsState ,
19- fetchedData ?: TFragment ,
2019 ) : Promise < GitifySubject > ;
2120
2221 /**
23- * Fetch remote data (if needed) and enrich a notification .
22+ * Enrich a notification. Settings may be unused for some handlers .
2423 */
25- fetchAndEnrich (
24+ enrich (
2625 notification : Notification ,
27- settings : SettingsState ,
26+ settings ?: SettingsState ,
27+ fetchedData ?: TFragment ,
2828 ) : Promise < GitifySubject > ;
2929
3030 /**
You can’t perform that action at this time.
0 commit comments