Various fixes

This commit is contained in:
Ilya Laktyushin 2022-08-24 19:45:48 +02:00
parent a51afacc73
commit 7f2ab1788f
2 changed files with 7 additions and 7 deletions

View File

@ -139,7 +139,7 @@ final class NavigationTransitionCoordinator {
let containerSize = self.container.bounds.size let containerSize = self.container.bounds.size
let topFrame = CGRect(origin: CGPoint(x: floorToScreenPixels(position * containerSize.width), y: 0.0), size: containerSize) let topFrame = CGRect(origin: CGPoint(x: floorToScreenPixels(position * containerSize.width), y: 0.0), size: containerSize)
let bottomFrame = CGRect(origin: CGPoint(x: ((position - 1.0) * containerSize.width * 0.3), y: 0.0), size: containerSize) let bottomFrame = CGRect(origin: CGPoint(x: self.isFlat ? -floorToScreenPixels((1.0 - position) * containerSize.width) : ((position - 1.0) * containerSize.width * 0.3), y: 0.0), size: containerSize)
var canInvokeCompletion = false var canInvokeCompletion = false
var hadEarlyCompletion = false var hadEarlyCompletion = false

View File

@ -130,7 +130,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail
return controller return controller
} }
private func phoneEntryController(countryCode: Int32, number: String, splahController: AuthorizationSequenceSplashController?) -> AuthorizationSequencePhoneEntryController { private func phoneEntryController(countryCode: Int32, number: String, splashController: AuthorizationSequenceSplashController?) -> AuthorizationSequencePhoneEntryController {
var currentController: AuthorizationSequencePhoneEntryController? var currentController: AuthorizationSequencePhoneEntryController?
for c in self.viewControllers { for c in self.viewControllers {
if let c = c as? AuthorizationSequencePhoneEntryController { if let c = c as? AuthorizationSequencePhoneEntryController {
@ -156,7 +156,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail
let _ = TelegramEngineUnauthorized(account: strongSelf.account).auth.setState(state: UnauthorizedAccountState(isTestingEnvironment: strongSelf.account.testingEnvironment, masterDatacenterId: strongSelf.account.masterDatacenterId, contents: .empty)).start() let _ = TelegramEngineUnauthorized(account: strongSelf.account).auth.setState(state: UnauthorizedAccountState(isTestingEnvironment: strongSelf.account.testingEnvironment, masterDatacenterId: strongSelf.account.masterDatacenterId, contents: .empty)).start()
} }
}) })
if let splahController = splahController { if let splahController = splashController {
controller.animateWithSplashController(splahController) controller.animateWithSplashController(splahController)
} }
controller.accountUpdated = { [weak self] updatedAccount in controller.accountUpdated = { [weak self] updatedAccount in
@ -992,7 +992,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail
if self.otherAccountPhoneNumbers.1.isEmpty { if self.otherAccountPhoneNumbers.1.isEmpty {
controllers.append(self.splashController()) controllers.append(self.splashController())
} else { } else {
controllers.append(self.phoneEntryController(countryCode: defaultCountryCode(), number: "", splahController: nil)) controllers.append(self.phoneEntryController(countryCode: defaultCountryCode(), number: "", splashController: nil))
} }
self.setViewControllers(controllers, animated: !self.viewControllers.isEmpty) self.setViewControllers(controllers, animated: !self.viewControllers.isEmpty)
} }
@ -1008,14 +1008,14 @@ public final class AuthorizationSequenceController: NavigationController, MFMail
break break
} }
} }
controllers.append(self.phoneEntryController(countryCode: countryCode, number: number, splahController: previousSplashController)) controllers.append(self.phoneEntryController(countryCode: countryCode, number: number, splashController: previousSplashController))
self.setViewControllers(controllers, animated: !self.viewControllers.isEmpty && previousSplashController == nil) self.setViewControllers(controllers, animated: !self.viewControllers.isEmpty && (previousSplashController == nil || self.viewControllers.count > 2))
case let .confirmationCodeEntry(number, type, _, timeout, nextType, _): case let .confirmationCodeEntry(number, type, _, timeout, nextType, _):
var controllers: [ViewController] = [] var controllers: [ViewController] = []
if !self.otherAccountPhoneNumbers.1.isEmpty { if !self.otherAccountPhoneNumbers.1.isEmpty {
controllers.append(self.splashController()) controllers.append(self.splashController())
} }
controllers.append(self.phoneEntryController(countryCode: defaultCountryCode(), number: "", splahController: nil)) controllers.append(self.phoneEntryController(countryCode: defaultCountryCode(), number: "", splashController: nil))
if case let .emailSetupRequired(appleSignInAllowed) = type { if case let .emailSetupRequired(appleSignInAllowed) = type {
controllers.append(self.emailSetupController(number: number, appleSignInAllowed: appleSignInAllowed)) controllers.append(self.emailSetupController(number: number, appleSignInAllowed: appleSignInAllowed))
} else { } else {