From 79eb359587df6f159ff2b52ff715cc3294751180 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Mon, 5 May 2025 20:08:50 +0400 Subject: [PATCH] Various fixes --- .../Sources/BotCheckoutControllerNode.swift | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/submodules/BotPaymentsUI/Sources/BotCheckoutControllerNode.swift b/submodules/BotPaymentsUI/Sources/BotCheckoutControllerNode.swift index ae27df6f66..191f9b27c8 100644 --- a/submodules/BotPaymentsUI/Sources/BotCheckoutControllerNode.swift +++ b/submodules/BotPaymentsUI/Sources/BotCheckoutControllerNode.swift @@ -611,7 +611,7 @@ private final class ActionButtonPanelNode: ASDisplayNode { private(set) var isAccepted: Bool = false var isAcceptedUpdated: (() -> Void)? var openRecurrentTerms: (() -> Void)? - private var recurrentConfirmationNode: RecurrentConfirmationNode? + var recurrentConfirmationNode: RecurrentConfirmationNode? func update(presentationData: PresentationData, layout: ContainerViewLayout, invoice: BotPaymentInvoice?, botName: String?) -> (CGFloat, CGFloat) { let bottomPanelVerticalInset: CGFloat = 16.0 @@ -1211,7 +1211,8 @@ final class BotCheckoutControllerNode: ItemListControllerNode, PKPaymentAuthoriz payString = self.presentationData.strings.CheckoutInfo_Pay } - self.actionButton.isEnabled = isButtonEnabled + self.actionButton.isEnabled = true + self.actionButton.isImplicitlyDisabled = !isButtonEnabled if let currentPaymentMethod = self.currentPaymentMethod { switch currentPaymentMethod { @@ -1268,7 +1269,11 @@ final class BotCheckoutControllerNode: ItemListControllerNode, PKPaymentAuthoriz } @objc func actionButtonPressed() { - self.pay() + if let recurrentConfirmationNode = self.actionButtonPanelNode.recurrentConfirmationNode, !self.actionButtonPanelNode.isAccepted { + recurrentConfirmationNode.layer.addShakeAnimation() + } else { + self.pay() + } } private func pay(savedCredentialsToken: TemporaryTwoStepPasswordToken? = nil, liabilityNoticeAccepted: Bool = false, receivedCredentials: BotPaymentCredentials? = nil) {