Skip to content

Commit

Permalink
WV-2919 notify fix (#4721)
Browse files Browse the repository at this point in the history
* logging

* Fixed initial notification count

* lint fix

* Remove log
  • Loading branch information
Tomcariello authored Oct 12, 2023
1 parent cd1dff0 commit 165350e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions web/js/modules/notifications/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ export function notificationsReducer(state = notificationReducerState, action) {
case SET_NOTIFICATIONS:
if (action.array.length > 0) {
const notificationsByType = separateByType(action.array);

const { layerNotices } = notificationsByType;
const numberOutagesUnseen = layerNotices.filter((notice) => notice.notification_type === 'outage').length;
const numberOutagesUnseen = notificationsByType.outages.length;
return {
...state,
number: getCount(notificationsByType),
Expand Down
2 changes: 1 addition & 1 deletion web/js/modules/notifications/reducers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('notificationsReducer', () => {
}),
).toEqual({
number: 1,
numberOutagesUnseen: 0,
numberOutagesUnseen: 1,
numberUnseen: 0,
type: 'outage',
isActive: true,
Expand Down

0 comments on commit 165350e

Please sign in to comment.