Cherry-pick session review changes

This commit is contained in:
Ali 2023-09-06 22:42:52 +04:00
parent c1d9eaa9e8
commit 230301594a
2 changed files with 9 additions and 4 deletions

View File

@ -941,7 +941,12 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
self.chatListDisplayNode.mainContainerNode.present = { [weak self] c in self.chatListDisplayNode.mainContainerNode.present = { [weak self] c in
if let strongSelf = self { 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))
}
} }
} }

View File

@ -708,7 +708,7 @@ private func mappedInsertEntries(context: AccountContext, nodeInteraction: ChatL
case .premiumUpgrade, .premiumAnnualDiscount, .premiumRestore: case .premiumUpgrade, .premiumAnnualDiscount, .premiumRestore:
nodeInteraction?.openPremiumIntro() nodeInteraction?.openPremiumIntro()
case .reviewLogin: case .reviewLogin:
nodeInteraction?.openActiveSessions() break
} }
case .hide: case .hide:
switch notice { switch notice {
@ -1028,7 +1028,7 @@ private func mappedUpdateEntries(context: AccountContext, nodeInteraction: ChatL
case .premiumUpgrade, .premiumAnnualDiscount, .premiumRestore: case .premiumUpgrade, .premiumAnnualDiscount, .premiumRestore:
nodeInteraction?.openPremiumIntro() nodeInteraction?.openPremiumIntro()
case .reviewLogin: case .reviewLogin:
nodeInteraction?.openActiveSessions() break
} }
case .hide: case .hide:
switch notice { switch notice {
@ -1623,7 +1623,7 @@ public final class ChatListNode: ListView {
animationBackgroundColor = UIColor(rgb: 0x474747) animationBackgroundColor = UIColor(rgb: 0x474747)
} }
//TODO:localize //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 { switch action {
case .info: case .info:
self?.interaction?.openActiveSessions() self?.interaction?.openActiveSessions()