Various fixes

This commit is contained in:
Ilya Laktyushin 2025-05-05 20:08:50 +04:00
parent ef20f4229c
commit 79eb359587

View File

@ -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) {