Skip to content

Commit

Permalink
Emoji completion: reverse results to show higher results at the top
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Dec 4, 2020
1 parent 6af78be commit 56ae4a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ts/components/emoji/lib.ts
Expand Up @@ -219,7 +219,8 @@ const fuse = new Fuse(data, {
});

export function search(query: string, count = 0): Array<EmojiData> {
const results = fuse.search(query.substr(0, 32));
// We reverse it because fuse returns low-score results first!
const results = fuse.search(query.substr(0, 32)).reverse();

if (count) {
return take(results, count);
Expand Down

0 comments on commit 56ae4a4

Please sign in to comment.