1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-11-24 08:22:29 +02:00

Use default sort order for ties (stable sort)

This commit is contained in:
Chen-I Lim 2020-11-06 12:48:11 -08:00
parent 1378b4d2b4
commit b86372f96b

View File

@ -296,6 +296,12 @@ class MutableBoardTree implements BoardTree {
}
let result = aValue.localeCompare(bValue)
if (result === 0) {
// In case of "ties", use the default order
result = this.defaultOrder(a, b)
}
if (sortOption.reversed) {
result = -result
}
@ -375,6 +381,11 @@ class MutableBoardTree implements BoardTree {
result = aValue.localeCompare(bValue)
}
if (result === 0) {
// In case of "ties", use the default order
result = this.defaultOrder(a, b)
}
if (sortOption.reversed) {
result = -result
}