diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/elements/ZapTheDevsCard.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/elements/ZapTheDevsCard.kt index d48bda125..25be95a48 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/elements/ZapTheDevsCard.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/elements/ZapTheDevsCard.kt @@ -90,6 +90,7 @@ import com.vitorpamplona.amethyst.ui.theme.imageModifier import com.vitorpamplona.quartz.events.Event import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.persistentListOf +import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.delay import kotlinx.coroutines.launch @@ -289,7 +290,7 @@ fun ZapDonationButton( animationSize: Dp = 14.dp, nav: INav, ) { - var wantsToZap by remember { mutableStateOf?>(null) } + var wantsToZap by remember { mutableStateOf?>(null) } var showErrorMessageDialog by remember { mutableStateOf(null) } var wantsToPay by remember(baseNote) { @@ -313,7 +314,7 @@ fun ZapDonationButton( onZappingProgress = { progress: Float -> scope.launch { zappingProgress = progress } }, - onMultipleChoices = { options -> wantsToZap = options }, + onMultipleChoices = { options -> wantsToZap = options.toImmutableList() }, onError = { _, message -> scope.launch { zappingProgress = 0f @@ -325,9 +326,10 @@ fun ZapDonationButton( }, modifier = Modifier.fillMaxWidth(), ) { - if (wantsToZap != null) { + wantsToZap?.let { ZapAmountChoicePopup( baseNote = baseNote, + zapAmountChoices = it, popupYOffset = iconSize, accountViewModel = accountViewModel, onDismiss = {