From e5cb5439ff14d5f2f30095b5fba1acbcf6de6ff3 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 19 Jun 2026 21:01:17 +0000 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_012fxWguG7dXgwwe2Et3JBjR --- .../emojipacks/membershipManagement/MyEmojiListScreen.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/MyEmojiListScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/MyEmojiListScreen.kt index 4016e869f3..3bd2e52b71 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/MyEmojiListScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/MyEmojiListScreen.kt @@ -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(