1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-28 03:08:30 +00:00

fix for NotificationGroup missing key

real notifications (from reducer) doesn't have "key" field so it needs to be created dynamically
This commit is contained in:
Szymon Lesisz 2018-10-03 14:39:23 +02:00
parent da3e1aa878
commit ac0b9508de
2 changed files with 2 additions and 3 deletions

View File

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

View File

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