Ensure there is never twice the same emoji
This commit is contained in:
parent
8b4c51139d
commit
9e73e95f55
|
@ -37,7 +37,7 @@ class EmojiDataSource @Inject constructor(
|
||||||
fun filterWith(query: String): List<EmojiItem> {
|
fun filterWith(query: String): List<EmojiItem> {
|
||||||
val words = query.split("\\s".toRegex())
|
val words = query.split("\\s".toRegex())
|
||||||
|
|
||||||
return rawData.emojis.values
|
return (rawData.emojis.values
|
||||||
.filter { emojiItem ->
|
.filter { emojiItem ->
|
||||||
emojiItem.name.contains(query, true)
|
emojiItem.name.contains(query, true)
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,8 @@ class EmojiDataSource @Inject constructor(
|
||||||
prev && emojiItem.keywords.any { keyword -> keyword.contains(word, true) }
|
prev && emojiItem.keywords.any { keyword -> keyword.contains(word, true) }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
.sortedBy { it.name }
|
.sortedBy { it.name })
|
||||||
|
.distinct()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getQuickReactions(): List<EmojiItem> {
|
fun getQuickReactions(): List<EmojiItem> {
|
||||||
|
|
Loading…
Reference in New Issue