mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
fix(api): ensure stable sort order when group is repeated
This commit is contained in:
committed by
Łukasz Mierzwa
parent
d913232869
commit
f2cc599a40
@@ -157,6 +157,9 @@ func getGroupLabel(group *models.APIAlertGroup, label string) string {
|
||||
}
|
||||
|
||||
func sortByStartsAt(i, j int, groups []models.APIAlertGroup, sortReverse bool) bool {
|
||||
if groups[i].LatestStartsAt == groups[j].LatestStartsAt {
|
||||
return groups[i].ID > groups[j].ID
|
||||
}
|
||||
if sortReverse {
|
||||
return groups[i].LatestStartsAt.After(groups[j].LatestStartsAt)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user