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

gitify-app / gitify / 12513393359

27 Dec 2024 07:42AM UTC coverage: 87.297% (+0.005%) from 87.292%
12513393359

Pull #1691

github

web-flow
Merge 27fa34239 into 48db6f9d2
Pull Request #1691: chore(deps): update @primer/octicons-react to v19.14.0

585 of 648 branches covered (90.28%)

Branch coverage included in aggregate %.

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

1566 of 1816 relevant lines covered (86.23%)

24.53 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