From fe392402c3e1893dc0416d7dec5a8554ee3408cc Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 25 Jun 2026 01:03:29 +0000 Subject: [PATCH] fix: extract MintPickerItem to fix Kotlin compiler OOM in MintPicker The deeply-nested Text() call inside DropdownMenu > forEach > DropdownMenuItem generated bytecode with MAXSTACK=26, which caused java.lang.OutOfMemoryError in the JVM bytecode frame analyzer (ConstantConditionEliminationMethodTransformer). Extracting DropdownMenuItem into a top-level private composable breaks the lambda nesting depth and lets the compiler succeed. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01SqmiRNcMEync2rVVbrPzWt --- .../loggedIn/wallet/CashuWalletScreen.kt | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/wallet/CashuWalletScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/wallet/CashuWalletScreen.kt index 0bd1784621..9c11e7369d 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/wallet/CashuWalletScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/wallet/CashuWalletScreen.kt @@ -1234,17 +1234,25 @@ private fun MintPicker( } DropdownMenu(expanded = expanded, onDismissRequest = { expanded = false }) { mints.forEach { m -> - DropdownMenuItem( - text = { Text(m) }, - onClick = { - onPick(m) - expanded = false - }, - ) + MintPickerItem(m) { + onPick(m) + expanded = false + } } } } +@Composable +private fun MintPickerItem( + mint: String, + onClick: () -> Unit, +) { + DropdownMenuItem( + text = { Text(mint) }, + onClick = onClick, + ) +} + // ============================================================================ // Send LN (melt) // ============================================================================