3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Fix case preview in !cases when two or more of the first case notes have the same timestamp

This commit is contained in:
Dragory 2019-04-20 20:15:31 +03:00
parent 9f7f87dc77
commit c38c2cc904

View file

@ -8,6 +8,7 @@ import {
errorMessage,
findRelevantAuditLogEntry,
INotifyUserResult,
multiSorter,
notifyUser,
NotifyUserStatus,
stripObjectToScalars,
@ -1272,7 +1273,7 @@ export class ModActionsPlugin extends ZeppelinPlugin<IModActionsPluginConfig> {
// Compact view (= regular message with a preview of each case)
const lines = [];
for (const theCase of casesToDisplay) {
theCase.notes.sort((a, b) => (a.created_at > b.created_at ? 1 : -1));
theCase.notes.sort(multiSorter(["created_at", "id"]));
const caseSummary = this.cases.getSummaryText(theCase);
lines.push(caseSummary);
}