Emoji completion: reverse results to show higher results at the top
This commit is contained in:
parent
6af78be51a
commit
56ae4a41eb
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue