also compare by key if the timestamps are the same

This commit is contained in:
Bruno Windels 2021-06-11 11:02:31 +02:00
parent 757e08c62c
commit 1d9709d4e3

View file

@ -135,7 +135,12 @@ class ReactionViewModel {
const a = this._annotation;
const b = other._annotation;
if (a && b) {
return a.firstTimestamp - b.firstTimestamp;
const cmp = a.firstTimestamp - b.firstTimestamp;
if (cmp === 0) {
return this.key < other.key ? -1 : 1;
} else {
return cmp;
}
} else if (a) {
return -1;
} else {