mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Reduce layerBacked usage
Improved shuffling
This commit is contained in:
@@ -87,7 +87,7 @@ final class AuthorizationSequenceCodeEntryControllerNode: ASDisplayNode, UITextF
|
||||
self.theme = theme
|
||||
|
||||
self.titleNode = ASTextNode()
|
||||
self.titleNode.isLayerBacked = true
|
||||
self.titleNode.isUserInteractionEnabled = false
|
||||
self.titleNode.displaysAsynchronously = false
|
||||
|
||||
self.titleIconNode = ASImageNode()
|
||||
@@ -120,7 +120,7 @@ final class AuthorizationSequenceCodeEntryControllerNode: ASDisplayNode, UITextF
|
||||
})
|
||||
|
||||
self.currentOptionNode = ASTextNode()
|
||||
self.currentOptionNode.isLayerBacked = true
|
||||
self.currentOptionNode.isUserInteractionEnabled = false
|
||||
self.currentOptionNode.displaysAsynchronously = false
|
||||
|
||||
self.nextOptionNode = HighlightableButtonNode()
|
||||
@@ -174,6 +174,26 @@ final class AuthorizationSequenceCodeEntryControllerNode: ASDisplayNode, UITextF
|
||||
self.countdownDisposable.dispose()
|
||||
}
|
||||
|
||||
func updateCode(_ code: String) {
|
||||
self.codeField.textField.text = code
|
||||
if let codeType = self.codeType {
|
||||
var codeLength: Int32?
|
||||
switch codeType {
|
||||
case let .call(length):
|
||||
codeLength = length
|
||||
case let .otherSession(length):
|
||||
codeLength = length
|
||||
case let .sms(length):
|
||||
codeLength = length
|
||||
default:
|
||||
break
|
||||
}
|
||||
if let codeLength = codeLength, code.count == Int(codeLength) {
|
||||
self.loginWithCode?(code)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func updateData(number: String, codeType: SentAuthorizationCodeType, nextType: AuthorizationCodeNextType?, timeout: Int32?) {
|
||||
self.codeType = codeType
|
||||
self.phoneNumber = number
|
||||
|
||||
Reference in New Issue
Block a user