mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 08:04:45 +00:00
Merge pull request #3287 from vitorpamplona/claude/practical-davinci-23zall
Deduplicate emoji packs in selection event
This commit is contained in:
+6
-1
@@ -104,7 +104,12 @@ private fun MyEmojiListView(
|
||||
selectionNote,
|
||||
accountViewModel,
|
||||
) { event ->
|
||||
event?.emojiPacks() ?: emptyList()
|
||||
// The kind 10030 selection event can carry the same `a` tag more than once (e.g. a pack
|
||||
// added twice). The grid below keys items by `address.toValue()`, so duplicates would
|
||||
// throw an IllegalArgumentException ("Key ... was already used"). Address is a data
|
||||
// class over (kind, pubKeyHex, dTag) — the same fields toValue() encodes — so distinct()
|
||||
// dedupes on exactly the grid key.
|
||||
event?.emojiPacks()?.distinct() ?: emptyList()
|
||||
}
|
||||
|
||||
Column(
|
||||
|
||||
Reference in New Issue
Block a user