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

gitify-app / gitify / 12299745471

12 Dec 2024 03:38PM UTC coverage: 87.322% (-0.04%) from 87.358%
12299745471

Pull #1673

github

web-flow
Merge 1ec0fa2e2 into 60c0ced92
Pull Request #1673: refactor: use semver to parse header and perform comparisons

586 of 649 branches covered (90.29%)

Branch coverage included in aggregate %.

3 of 3 new or added lines in 1 file covered. (100.0%)

1556 of 1804 relevant lines covered (86.25%)

24.54 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