From 4d37b67932aa2148dd042cafba1c242d7faab442 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Sun, 13 Jun 2021 13:27:35 +0300 Subject: [PATCH] Add phone number validation block removal animation --- .../Sources/ChangePhoneNumberIntroController.swift | 2 +- .../TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/submodules/SettingsUI/Sources/ChangePhoneNumberIntroController.swift b/submodules/SettingsUI/Sources/ChangePhoneNumberIntroController.swift index fb8ce7a756..06b2801b5a 100644 --- a/submodules/SettingsUI/Sources/ChangePhoneNumberIntroController.swift +++ b/submodules/SettingsUI/Sources/ChangePhoneNumberIntroController.swift @@ -143,7 +143,7 @@ public final class ChangePhoneNumberIntroController: ViewController { } func proceed() { - self.present(textAlertController(context: self.context, title: nil, text: self.presentationData.strings.PhoneNumberHelp_Alert, actions: [TextAlertAction(type: .defaultAction, title: self.presentationData.strings.Common_Cancel, action: {}), TextAlertAction(type: .genericAction, title: self.presentationData.strings.Common_OK, action: { [weak self] in + self.present(textAlertController(context: self.context, title: nil, text: self.presentationData.strings.PhoneNumberHelp_Alert, actions: [TextAlertAction(type: .defaultAction, title: self.presentationData.strings.Common_Cancel, action: {}), TextAlertAction(type: .genericAction, title: self.presentationData.strings.TwoFactorSetup_Email_Action, action: { [weak self] in if let strongSelf = self { (strongSelf.navigationController as? NavigationController)?.replaceTopController(ChangePhoneNumberController(context: strongSelf.context), animated: true) } diff --git a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift index e1f903fa48..3bf8501e47 100644 --- a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift +++ b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift @@ -2925,7 +2925,7 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD var currentCallsPrivate: Bool? var previousVideoCallsAvailable: Bool? = true var currentVideoCallsAvailable: Bool? - + if let previousCachedData = previousData?.cachedData as? CachedUserData, let cachedData = data.cachedData as? CachedUserData { previousCallsPrivate = previousCachedData.callsPrivate ?? false currentCallsPrivate = cachedData.callsPrivate @@ -2934,10 +2934,12 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD currentVideoCallsAvailable = cachedData.videoCallsAvailable } + if let previousSuggestPhoneNumberConfirmation = previousData?.globalSettings?.suggestPhoneNumberConfirmation, previousSuggestPhoneNumberConfirmation != data.globalSettings?.suggestPhoneNumberConfirmation { + infoUpdated = true + } if previousCallsPrivate != currentCallsPrivate || previousVideoCallsAvailable != currentVideoCallsAvailable { infoUpdated = true } - if (previousCall == nil) != (currentCall == nil) { infoUpdated = true } @@ -5869,7 +5871,9 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD } for sectionId in removeRegularSections { if let sectionNode = self.regularSections.removeValue(forKey: sectionId) { - sectionNode.removeFromSupernode() + transition.updateAlpha(node: sectionNode, alpha: 0.0, completion: { [weak sectionNode] _ in + sectionNode?.removeFromSupernode() + }) } }