Skip to content

Commit b1604a5

Browse files
marie-jantleblanc
authored andcommitted
fix(navbar): prevent console error when notifications are in error (#367)
1 parent f1ab140 commit b1604a5

File tree

1 file changed

+7
-3
lines changed
  • packages/manager/modules/navbar/src/notifications-menu

1 file changed

+7
-3
lines changed

packages/manager/modules/navbar/src/notifications-menu/controller.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import isEmpty from 'lodash/isEmpty';
2+
import filter from 'lodash/filter';
3+
import some from 'lodash/some';
24

35
import { Environment } from '@ovh-ux/manager-config';
46
import { ANIMATED_STATUS } from './constants';
@@ -47,7 +49,7 @@ export default class NotificationsCtrl {
4749
}
4850

4951
static shouldAnimateIcon(sublinks) {
50-
return sublinks.some(({ isActive, level }) => ANIMATED_STATUS.includes(level) && isActive);
52+
return some(sublinks, ({ isActive, level }) => ANIMATED_STATUS.includes(level) && isActive);
5153
}
5254

5355

@@ -67,8 +69,10 @@ export default class NotificationsCtrl {
6769
type: 'action',
6870
});
6971

70-
const notificationsToAcknowledge = this.sublinks
71-
.filter(({ acknowledged, isActive }) => !acknowledged && isActive);
72+
const notificationsToAcknowledge = filter(
73+
this.sublinks,
74+
({ acknowledged, isActive }) => !acknowledged && isActive,
75+
);
7276

7377
if (!isEmpty(notificationsToAcknowledge)) {
7478
return this.NavbarNotifications.updateNotifications({

0 commit comments

Comments
 (0)