Concat new column data with existing data

This commit is contained in:
Bruno Lemos
2018-11-03 19:34:38 -03:00
parent 1ab0b2ee37
commit f3bf8678e9
2 changed files with 2 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ export class EventCardsContainer extends PureComponent<
if (Array.isArray(events)) {
const orderedEvents = _(events)
.concat(this.state.events)
.uniqBy('id')
.orderBy(['updated_at', 'created_at'], ['desc', 'desc'])
.value()

View File

@@ -47,6 +47,7 @@ export class NotificationCardsContainer extends PureComponent<
if (Array.isArray(notifications)) {
this.setState({
notifications: _(notifications)
.concat(this.state.notifications)
.uniqBy('id')
.orderBy(
['unread', 'updated_at', 'created_at'],