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

gitify-app / gitify / 12556778518

31 Dec 2024 07:20AM UTC coverage: 87.209% (-0.09%) from 87.298%
12556778518

Pull #1692

github

web-flow
Merge fbd38789a into d4bbba0c0
Pull Request #1692: refactor(shared): create `electron-log` wrapper

591 of 656 branches covered (90.09%)

Branch coverage included in aggregate %.

39 of 56 new or added lines in 16 files covered. (69.64%)

33 existing lines in 3 files now uncovered.

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