fix: Deterministic sorting of search results. (#343)
* Deterministic sorting of search results. This is important for reliable tests, e.g. if you are snapshotting views and comparing to reference images. * fix prettierrelease
parent
a0ce9d8122
commit
956aaa91f3
|
@ -181,7 +181,11 @@ export default class NimbleEmojiIndex {
|
||||||
var aScore = scores[a.id],
|
var aScore = scores[a.id],
|
||||||
bScore = scores[b.id]
|
bScore = scores[b.id]
|
||||||
|
|
||||||
return aScore - bScore
|
if (aScore == bScore) {
|
||||||
|
return a.id.localeCompare(b.id)
|
||||||
|
} else {
|
||||||
|
return aScore - bScore
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue