From 7f2ab1788ff168b788f20c4896822d74f3944214 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Wed, 24 Aug 2022 19:45:48 +0200 Subject: [PATCH] Various fixes --- .../Source/NavigationTransitionCoordinator.swift | 2 +- .../Sources/AuthorizationSequenceController.swift | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/submodules/Display/Source/NavigationTransitionCoordinator.swift b/submodules/Display/Source/NavigationTransitionCoordinator.swift index 682278780d..b3c2d7873d 100644 --- a/submodules/Display/Source/NavigationTransitionCoordinator.swift +++ b/submodules/Display/Source/NavigationTransitionCoordinator.swift @@ -139,7 +139,7 @@ final class NavigationTransitionCoordinator { let containerSize = self.container.bounds.size 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 hadEarlyCompletion = false diff --git a/submodules/TelegramUI/Sources/AuthorizationSequenceController.swift b/submodules/TelegramUI/Sources/AuthorizationSequenceController.swift index 3ad94099cc..0c86f9cbc6 100644 --- a/submodules/TelegramUI/Sources/AuthorizationSequenceController.swift +++ b/submodules/TelegramUI/Sources/AuthorizationSequenceController.swift @@ -130,7 +130,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail 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? for c in self.viewControllers { 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() } }) - if let splahController = splahController { + if let splahController = splashController { controller.animateWithSplashController(splahController) } controller.accountUpdated = { [weak self] updatedAccount in @@ -992,7 +992,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail if self.otherAccountPhoneNumbers.1.isEmpty { controllers.append(self.splashController()) } 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) } @@ -1008,14 +1008,14 @@ public final class AuthorizationSequenceController: NavigationController, MFMail break } } - controllers.append(self.phoneEntryController(countryCode: countryCode, number: number, splahController: previousSplashController)) - self.setViewControllers(controllers, animated: !self.viewControllers.isEmpty && previousSplashController == nil) + controllers.append(self.phoneEntryController(countryCode: countryCode, number: number, splashController: previousSplashController)) + self.setViewControllers(controllers, animated: !self.viewControllers.isEmpty && (previousSplashController == nil || self.viewControllers.count > 2)) case let .confirmationCodeEntry(number, type, _, timeout, nextType, _): var controllers: [ViewController] = [] if !self.otherAccountPhoneNumbers.1.isEmpty { 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 { controllers.append(self.emailSetupController(number: number, appleSignInAllowed: appleSignInAllowed)) } else {