From 6a3b05d85e4f7b9e78e428196a9764d62b8b897c Mon Sep 17 00:00:00 2001 From: Etienne Lemay Date: Tue, 18 Apr 2017 10:28:44 -0400 Subject: [PATCH] Slice search results only when necessary --- src/utils/emoji-index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/emoji-index.js b/src/utils/emoji-index.js index e614bf8..d4a5164 100644 --- a/src/utils/emoji-index.js +++ b/src/utils/emoji-index.js @@ -97,7 +97,7 @@ function search(value, emojisToShowFilter = () => true, maxResults = 75) { results = results.filter((result) => emojisToShowFilter(data.emojis[result.id].unified)) } - if (results && results.length) { + if (results && results.length > maxResults) { results = results.slice(0, maxResults) } }