Skip to content

Commit 79eb359

Browse files
committed
Various fixes
1 parent ef20f42 commit 79eb359

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

submodules/BotPaymentsUI/Sources/BotCheckoutControllerNode.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ private final class ActionButtonPanelNode: ASDisplayNode {
611611
private(set) var isAccepted: Bool = false
612612
var isAcceptedUpdated: (() -> Void)?
613613
var openRecurrentTerms: (() -> Void)?
614-
private var recurrentConfirmationNode: RecurrentConfirmationNode?
614+
var recurrentConfirmationNode: RecurrentConfirmationNode?
615615

616616
func update(presentationData: PresentationData, layout: ContainerViewLayout, invoice: BotPaymentInvoice?, botName: String?) -> (CGFloat, CGFloat) {
617617
let bottomPanelVerticalInset: CGFloat = 16.0
@@ -1211,7 +1211,8 @@ final class BotCheckoutControllerNode: ItemListControllerNode, PKPaymentAuthoriz
12111211
payString = self.presentationData.strings.CheckoutInfo_Pay
12121212
}
12131213

1214-
self.actionButton.isEnabled = isButtonEnabled
1214+
self.actionButton.isEnabled = true
1215+
self.actionButton.isImplicitlyDisabled = !isButtonEnabled
12151216

12161217
if let currentPaymentMethod = self.currentPaymentMethod {
12171218
switch currentPaymentMethod {
@@ -1268,7 +1269,11 @@ final class BotCheckoutControllerNode: ItemListControllerNode, PKPaymentAuthoriz
12681269
}
12691270

12701271
@objc func actionButtonPressed() {
1271-
self.pay()
1272+
if let recurrentConfirmationNode = self.actionButtonPanelNode.recurrentConfirmationNode, !self.actionButtonPanelNode.isAccepted {
1273+
recurrentConfirmationNode.layer.addShakeAnimation()
1274+
} else {
1275+
self.pay()
1276+
}
12721277
}
12731278

12741279
private func pay(savedCredentialsToken: TemporaryTwoStepPasswordToken? = nil, liabilityNoticeAccepted: Bool = false, receivedCredentials: BotPaymentCredentials? = nil) {

0 commit comments

Comments
 (0)