From 230301594a1e61b6084d91528a05cae3172a38d1 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Wed, 6 Sep 2023 22:42:52 +0400 Subject: [PATCH] Cherry-pick session review changes --- submodules/ChatListUI/Sources/ChatListController.swift | 7 ++++++- submodules/ChatListUI/Sources/Node/ChatListNode.swift | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/submodules/ChatListUI/Sources/ChatListController.swift b/submodules/ChatListUI/Sources/ChatListController.swift index 508a43dfe2..fc607bf8ca 100644 --- a/submodules/ChatListUI/Sources/ChatListController.swift +++ b/submodules/ChatListUI/Sources/ChatListController.swift @@ -941,7 +941,12 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController self.chatListDisplayNode.mainContainerNode.present = { [weak self] c in if let strongSelf = self { - strongSelf.present(c, in: .window(.root)) + if c is UndoOverlayController { + strongSelf.dismissAllUndoControllers() + strongSelf.present(c, in: .current) + } else { + strongSelf.present(c, in: .window(.root)) + } } } diff --git a/submodules/ChatListUI/Sources/Node/ChatListNode.swift b/submodules/ChatListUI/Sources/Node/ChatListNode.swift index d1e658d0d9..9cc5fa5f33 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListNode.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListNode.swift @@ -708,7 +708,7 @@ private func mappedInsertEntries(context: AccountContext, nodeInteraction: ChatL case .premiumUpgrade, .premiumAnnualDiscount, .premiumRestore: nodeInteraction?.openPremiumIntro() case .reviewLogin: - nodeInteraction?.openActiveSessions() + break } case .hide: switch notice { @@ -1028,7 +1028,7 @@ private func mappedUpdateEntries(context: AccountContext, nodeInteraction: ChatL case .premiumUpgrade, .premiumAnnualDiscount, .premiumRestore: nodeInteraction?.openPremiumIntro() case .reviewLogin: - nodeInteraction?.openActiveSessions() + break } case .hide: switch notice { @@ -1623,7 +1623,7 @@ public final class ChatListNode: ListView { animationBackgroundColor = UIColor(rgb: 0x474747) } //TODO:localize - self.present?(UndoOverlayController(presentationData: presentationData, content: .universal(animation: "anim_success", scale: 1.0, colors: ["info1.info1.stroke": animationBackgroundColor, "info2.info2.Fill": animationBackgroundColor], title: "New Login Allowed", text: "You can check the list of your active logins in [Settings > Devices]().", customUndoText: nil, timeout: 5), elevatedLayout: true, action: { [weak self] action in + self.present?(UndoOverlayController(presentationData: presentationData, content: .universal(animation: "anim_success", scale: 1.0, colors: ["info1.info1.stroke": animationBackgroundColor, "info2.info2.Fill": animationBackgroundColor], title: "New Login Allowed", text: "You can check the list of your active logins in [Settings > Devices]().", customUndoText: nil, timeout: 5), elevatedLayout: false, action: { [weak self] action in switch action { case .info: self?.interaction?.openActiveSessions()