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

@@ -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;
});