RED-4590, remove in place sorting, copy arrays.
This commit is contained in:
parent
00a648657c
commit
bb1a2910d4
@ -70,11 +70,10 @@ export class NotificationsComponent {
|
||||
return n.creationDate.split('T')[0];
|
||||
});
|
||||
|
||||
const grouped = [...groupedMap.entries()];
|
||||
const sorted = grouped.sort(([aDate], [bDate]) => chronologically(aDate, bDate));
|
||||
return sorted.map(([date, _notifications]) => ({
|
||||
const sortedGroups = [...groupedMap.entries()].sort(([aDate], [bDate]) => chronologically(aDate, bDate));
|
||||
return sortedGroups.map(([date, _notifications]) => ({
|
||||
date: isToday(date) ? todayTranslation : this._datePipe.transform(date, 'sophisticatedDate'),
|
||||
notifications: _notifications.sort((a, b) => chronologically(a.creationDate, b.creationDate)),
|
||||
notifications: [..._notifications].sort((a, b) => chronologically(a.creationDate, b.creationDate)),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user