From 9e73e95f55f1206bb2387831e740bab37635dff3 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Sun, 22 Dec 2019 08:36:54 +0100 Subject: [PATCH] Ensure there is never twice the same emoji --- .../vector/riotx/features/reactions/data/EmojiDataSource.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/reactions/data/EmojiDataSource.kt b/vector/src/main/java/im/vector/riotx/features/reactions/data/EmojiDataSource.kt index 873ab90254..8abea21667 100644 --- a/vector/src/main/java/im/vector/riotx/features/reactions/data/EmojiDataSource.kt +++ b/vector/src/main/java/im/vector/riotx/features/reactions/data/EmojiDataSource.kt @@ -37,7 +37,7 @@ class EmojiDataSource @Inject constructor( fun filterWith(query: String): List { val words = query.split("\\s".toRegex()) - return rawData.emojis.values + return (rawData.emojis.values .filter { emojiItem -> emojiItem.name.contains(query, true) } @@ -48,7 +48,8 @@ class EmojiDataSource @Inject constructor( prev && emojiItem.keywords.any { keyword -> keyword.contains(word, true) } }) } - .sortedBy { it.name } + .sortedBy { it.name }) + .distinct() } fun getQuickReactions(): List {