3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-16 14:11:50 +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, errorMessage,
findRelevantAuditLogEntry, findRelevantAuditLogEntry,
INotifyUserResult, INotifyUserResult,
multiSorter,
notifyUser, notifyUser,
NotifyUserStatus, NotifyUserStatus,
stripObjectToScalars, stripObjectToScalars,
@ -1272,7 +1273,7 @@ export class ModActionsPlugin extends ZeppelinPlugin<IModActionsPluginConfig> {
// Compact view (= regular message with a preview of each case) // Compact view (= regular message with a preview of each case)
const lines = []; const lines = [];
for (const theCase of casesToDisplay) { 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); const caseSummary = this.cases.getSummaryText(theCase);
lines.push(caseSummary); lines.push(caseSummary);
} }