fix for NotificationGroup missing key

real notifications (from reducer) doesn't have "key" field so it needs to be created dynamically
pull/120/head
Szymon Lesisz 6 years ago
parent da3e1aa878
commit ac0b9508de

@ -108,7 +108,7 @@ Group.propTypes = {
close: PropTypes.func.isRequired,
groupNotifications: PropTypes.arrayOf(
PropTypes.shape({
key: PropTypes.number,
key: PropTypes.object,
type: PropTypes.string,
title: PropTypes.string,
message: PropTypes.string,

@ -2,7 +2,6 @@ import React, { Component } from 'react';
import styled from 'styled-components';
import PropTypes from 'prop-types';
import { PRIORITY } from 'constants/notifications';
import Group from './components/Group';
const Wrapper = styled.div``;
@ -14,7 +13,7 @@ class NotificationsGroup extends Component {
if (!acc[key]) {
acc[key] = [];
}
acc[key].push(obj);
acc[key].push({ ...obj, key: obj });
return acc;
}, {});

Loading…
Cancel
Save