diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ReusableZapButton.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ReusableZapButton.kt index 9119521101..7e74f2a3fd 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ReusableZapButton.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ReusableZapButton.kt @@ -170,9 +170,6 @@ fun ReusableZapButton( onChangeAmount = { wantsToZap = null }, - onCustomAmount = { - wantsToZap = null - }, onError = { _, message, user -> scope.launch { zappingProgress = 0f diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt index 8e6d8730ea..336f894ecc 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt @@ -1242,7 +1242,8 @@ fun ZapReaction( ) } }, - onLongClick = { wantsToSetCustomZap = true }, + onLongClick = { nav.nav(Route.UpdateZapAmount()) }, + onDoubleClick = { wantsToSetCustomZap = true }, ), ) { if (wantsToZap) { @@ -1261,12 +1262,6 @@ fun ZapReaction( nav.nav(Route.UpdateZapAmount()) } }, - onCustomAmount = { - scope.launch { - wantsToZap = false - wantsToSetCustomZap = true - } - }, onError = { _, message, user -> scope.launch { zappingProgress = 0f @@ -1891,7 +1886,6 @@ fun ZapAmountChoicePopup( onZapStarts: () -> Unit, onDismiss: () -> Unit, onChangeAmount: () -> Unit, - onCustomAmount: () -> Unit, onError: (title: String, text: String, user: User?) -> Unit, onProgress: (percent: Float) -> Unit, onPayViaIntent: (ImmutableList) -> Unit, @@ -1900,7 +1894,7 @@ fun ZapAmountChoicePopup( accountViewModel.account.settings.syncedSettings.zaps.zapAmountChoices .collectAsStateWithLifecycle() - ZapAmountChoicePopup(baseNote, zapAmountChoices, accountViewModel, popupYOffset, onZapStarts, onDismiss, onChangeAmount, onCustomAmount, onError, onProgress, onPayViaIntent) + ZapAmountChoicePopup(baseNote, zapAmountChoices, accountViewModel, popupYOffset, onZapStarts, onDismiss, onChangeAmount, onError, onProgress, onPayViaIntent) } @Composable @@ -1912,13 +1906,12 @@ fun ZapAmountChoicePopup( onZapStarts: () -> Unit, onDismiss: () -> Unit, onChangeAmount: () -> Unit, - onCustomAmount: () -> Unit, onError: (title: String, text: String, user: User?) -> Unit, onProgress: (percent: Float) -> Unit, onPayViaIntent: (ImmutableList) -> Unit, ) { val visibilityState = rememberVisibilityState(onDismiss) - ZapAmountChoicePopup(baseNote, zapAmountChoices, accountViewModel, popupYOffset, visibilityState, onZapStarts, onChangeAmount, onCustomAmount, onError, onProgress, onPayViaIntent) + ZapAmountChoicePopup(baseNote, zapAmountChoices, accountViewModel, popupYOffset, visibilityState, onZapStarts, onChangeAmount, onError, onProgress, onPayViaIntent) } @OptIn(ExperimentalFoundationApi::class, ExperimentalLayoutApi::class) @@ -1931,7 +1924,6 @@ fun ZapAmountChoicePopup( visibilityState: MutableTransitionState, onZapStarts: () -> Unit, onChangeAmount: () -> Unit, - onCustomAmount: () -> Unit, onError: (title: String, text: String, user: User?) -> Unit, onProgress: (percent: Float) -> Unit, onPayViaIntent: (ImmutableList) -> Unit, @@ -1968,10 +1960,6 @@ fun ZapAmountChoicePopup( visibilityState.targetState = false }, onChangeAmount = onChangeAmount, - onCustomAmount = { - visibilityState.targetState = false - onCustomAmount() - }, ) } } @@ -1983,7 +1971,6 @@ fun ZapAmountChoicePopupContent( zapAmountChoices: ImmutableList, onZap: (Long) -> Unit, onChangeAmount: () -> Unit, - onCustomAmount: () -> Unit, ) { Box(HalfPadding, contentAlignment = Center) { ElevatedCard( @@ -2001,7 +1988,7 @@ fun ZapAmountChoicePopupContent( ZapAmountChip( amountInSats = amountInSats, onClick = { onZap(amountInSats) }, - onLongClick = onCustomAmount, + onLongClick = onChangeAmount, ) } ClickableBox( @@ -2068,7 +2055,6 @@ fun ZapAmountChoicePopupPreview() { zapAmountChoices = persistentListOf(50L, 100L, 500L, 1_000L, 5_000L, 10_000L, 100_000L), onZap = {}, onChangeAmount = {}, - onCustomAmount = {}, ) } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/screen/NestActionBar.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/screen/NestActionBar.kt index 9e7faafb92..623c717a85 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/screen/NestActionBar.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/screen/NestActionBar.kt @@ -437,9 +437,10 @@ private fun EndCluster( * applies the user's configured zap amount choices the same way the * normal note ⚡ button does (single-tap fires the default amount; * multi-choice opens [ZapAmountChoicePopup]; an unconfigured account - * opens [ZapCustomDialog]). Inside the multi-choice popup the Tune - * button jumps to the [Route.UpdateZapAmount] settings screen and - * long-press on a chip opens [ZapCustomDialog]. + * opens [ZapCustomDialog]). Long-press routes to the + * [Route.UpdateZapAmount] settings screen via the activity's + * [BouncingIntentNav] (no-op when the route can't be expressed as a + * `nostr:` URI — same fallback as the chat panel uses). */ @OptIn(ExperimentalUuidApi::class) @Composable @@ -536,12 +537,6 @@ private fun NestZapButton( nav.nav(Route.UpdateZapAmount()) } }, - onCustomAmount = { - scope.launch { - wantsToZap = false - wantsToSetCustomZap = true - } - }, onError = { _, message, user -> scope.launch { zappingProgress = 0f