more stable sorting order for reactions

This commit is contained in:
Bruno Windels 2021-06-03 19:57:29 +02:00
parent bb8acbefa3
commit 2eb2e4e9b3

View File

@ -83,7 +83,13 @@ class ReactionViewModel extends ViewModel {
} }
_compare(other) { _compare(other) {
return this._annotation.count - other._annotation.count; const a = this._annotation;
const b = other._annotation;
if (a.count !== b.count) {
return b.count - a.count;
} else {
return a.firstTimestamp - b.firstTimestamp;
}
} }
toggleReaction() { toggleReaction() {