notifications: fixes

This commit is contained in:
Matteo Pagliazzi
2018-02-04 13:28:05 +01:00
parent 2af99d7c65
commit 4efbbd7bac
15 changed files with 118 additions and 37 deletions

View File

@@ -7,7 +7,7 @@ import cloneDeep from 'lodash/cloneDeep';
function markNotificationAsRead (user) {
const index = user.notifications.findIndex(notification => {
return notification.type === 'NEW_MYSTERY_ITEMS';
return notification && notification.type === 'NEW_MYSTERY_ITEMS';
});
if (index !== -1) user.notifications.splice(index, 1);