notifications: fixes
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -11,7 +11,9 @@ import content from '../content/index';
|
||||
function markNotificationAsRead (user, cardType) {
|
||||
const indexToRemove = user.notifications.findIndex(notification => {
|
||||
if (
|
||||
notification &&
|
||||
notification.type === 'CARD_RECEIVED' &&
|
||||
notification.data &&
|
||||
notification.data.card === cardType
|
||||
) return true;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user