mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 08:04:45 +00:00
fix: dedupe emoji pack addresses in My Emoji List grid
A kind 10030 emoji selection event can carry the same `a` tag more than once. MyEmojiListScreen keys its LazyVerticalGrid items by address.toValue(), so a duplicate address crashed Compose with "Key ... was already used". Deduplicate on the same value used as the grid key before rendering. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012fxWguG7dXgwwe2Et3JBjR
This commit is contained in:
+5
-1
@@ -104,7 +104,11 @@ 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"). Dedupe on the same
|
||||
// value used as the key.
|
||||
event?.emojiPacks()?.distinctBy { it.toValue() } ?: emptyList()
|
||||
}
|
||||
|
||||
Column(
|
||||
|
||||
Reference in New Issue
Block a user