• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gitify-app / gitify / 12586431667

02 Jan 2025 05:40PM UTC coverage: 87.209%. Remained the same
12586431667

Pull #1700

github

web-flow
Merge 35a8d97a0 into 0e8d27442
Pull Request #1700: build(deps): bump cross-spawn from 7.0.3 to 7.0.6

591 of 656 branches covered (90.09%)

Branch coverage included in aggregate %.

1584 of 1838 relevant lines covered (86.18%)

24.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.96
/src/renderer/utils/notifications/remove.ts
1
import type { AccountNotifications, SettingsState } from '../../types';
2
import type { Notification } from '../../typesGitHub';
3
import { getAccountUUID } from '../auth/utils';
70✔
4

5
export function removeNotifications(
70✔
6
  settings: SettingsState,
7
  notificationsToRemove: Notification[],
8
  allNotifications: AccountNotifications[],
9
): AccountNotifications[] {
10
  if (settings.delayNotificationState) {
8✔
11
    return allNotifications;
2✔
12
  }
13

14
  if (notificationsToRemove.length === 0) {
6!
15
    return allNotifications;
×
16
  }
17

18
  const removeNotificationAccount = notificationsToRemove[0].account;
6✔
19
  const removeNotificationIDs = notificationsToRemove.map(
6✔
20
    (notification) => notification.id,
6✔
21
  );
22

23
  const accountIndex = allNotifications.findIndex(
6✔
24
    (accountNotifications) =>
25
      getAccountUUID(accountNotifications.account) ===
2✔
26
      getAccountUUID(removeNotificationAccount),
27
  );
28

29
  if (accountIndex !== -1) {
6✔
30
    const updatedNotifications = [...allNotifications];
2✔
31
    updatedNotifications[accountIndex] = {
2✔
32
      ...updatedNotifications[accountIndex],
33
      notifications: updatedNotifications[accountIndex].notifications.filter(
34
        (notification) => !removeNotificationIDs.includes(notification.id),
2✔
35
      ),
36
    };
37
    return updatedNotifications;
2✔
38
  }
39

40
  return allNotifications;
4✔
41
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc