MCPcopy
hub / github.com/gitify-app/gitify / enrichNotifications

Function enrichNotifications

src/renderer/utils/notifications/notifications.ts:152–170  ·  view source on GitHub ↗
(
  notifications: GitifyNotification[],
  settings: SettingsState,
)

Source from the content-addressed store, hash-verified

150 * @returns The same notifications with subject fields populated from the API.
151 */
152export async function enrichNotifications(
153 notifications: GitifyNotification[],
154 settings: SettingsState,
155): Promise<GitifyNotification[]> {
156 if (!settings.detailedNotifications) {
157 return notifications;
158 }
159
160 const mergedResults = await fetchNotificationDetailsInBatches(notifications);
161
162 const enrichedNotifications = await Promise.all(
163 notifications.map(async (notification: GitifyNotification) => {
164 const fragment = mergedResults.get(notification);
165
166 return enrichNotification(notification, settings, fragment);
167 }),
168 );
169 return enrichedNotifications;
170}
171
172/**
173 * Fetch notification details in batches to avoid overwhelming the API.

Callers 2

getAllNotificationsFunction · 0.85

Calls 2

enrichNotificationFunction · 0.85

Tested by

no test coverage detected