Refactoring [skip ci]

This commit is contained in:
Ali
2021-07-05 00:48:11 +04:00
parent 58217226c0
commit 4893e41de2
56 changed files with 783 additions and 840 deletions

View File

@@ -944,7 +944,7 @@ final class BotCheckoutControllerNode: ItemListControllerNode, PKPaymentAuthoriz
self.listNode.supernode?.insertSubnode(self.inProgressDimNode, aboveSubnode: self.listNode)
self.passwordTipDisposable = (twoStepVerificationConfiguration(account: self.context.account)
self.passwordTipDisposable = (self.context.engine.auth.twoStepVerificationConfiguration()
|> deliverOnMainQueue).start(next: { [weak self] value in
guard let strongSelf = self else {
return
@@ -1069,7 +1069,7 @@ final class BotCheckoutControllerNode: ItemListControllerNode, PKPaymentAuthoriz
if let savedCredentialsToken = savedCredentialsToken {
credentials = .saved(id: id, tempPassword: savedCredentialsToken.token)
} else {
let _ = (cachedTwoStepPasswordToken(postbox: self.context.account.postbox)
let _ = (self.context.engine.auth.cachedTwoStepPasswordToken()
|> deliverOnMainQueue).start(next: { [weak self] token in
if let strongSelf = self {
let timestamp = strongSelf.context.account.network.getApproximateRemoteTimestamp()
@@ -1340,7 +1340,7 @@ final class BotCheckoutControllerNode: ItemListControllerNode, PKPaymentAuthoriz
}),
TextAlertAction(type: .genericAction, title: strongSelf.presentationData.strings.Common_Yes, action: {
if let strongSelf = self {
let _ = cacheTwoStepPasswordToken(postbox: strongSelf.context.account.postbox, token: token).start()
let _ = strongSelf.context.engine.auth.cacheTwoStepPasswordToken(token: token).start()
strongSelf.pay(savedCredentialsToken: token)
}
})