mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-17 20:00:38 +00:00
Fix Storage Usage presentation from Clear Cache suggestion popup
This commit is contained in:
parent
840b3cf22a
commit
4c1ea3b5c6
@ -933,6 +933,9 @@ public func storageUsageController(context: AccountContext, cacheUsagePromise: P
|
|||||||
}
|
}
|
||||||
|
|
||||||
let controller = ItemListController(context: context, state: signal)
|
let controller = ItemListController(context: context, state: signal)
|
||||||
|
if isModal {
|
||||||
|
controller.navigationPresentation = .modal
|
||||||
|
}
|
||||||
presentControllerImpl = { [weak controller] c, contextType, a in
|
presentControllerImpl = { [weak controller] c, contextType, a in
|
||||||
controller?.present(c, in: contextType, with: a)
|
controller?.present(c, in: contextType, with: a)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7773,23 +7773,22 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
|
|
||||||
items.append(DeleteChatPeerActionSheetItem(context: self.context, peer: peer, chatPeer: peer, action: .clearCacheSuggestion, strings: self.presentationData.strings, nameDisplayOrder: self.presentationData.nameDisplayOrder))
|
items.append(DeleteChatPeerActionSheetItem(context: self.context, peer: peer, chatPeer: peer, action: .clearCacheSuggestion, strings: self.presentationData.strings, nameDisplayOrder: self.presentationData.nameDisplayOrder))
|
||||||
|
|
||||||
|
var presented = false
|
||||||
items.append(ActionSheetButtonItem(title: self.presentationData.strings.ClearCache_FreeSpace, color: .accent, action: { [weak self, weak actionSheet] in
|
items.append(ActionSheetButtonItem(title: self.presentationData.strings.ClearCache_FreeSpace, color: .accent, action: { [weak self, weak actionSheet] in
|
||||||
actionSheet?.dismissAnimated()
|
actionSheet?.dismissAnimated()
|
||||||
if let strongSelf = self {
|
if let strongSelf = self, !presented {
|
||||||
let controller = storageUsageController(context: strongSelf.context, isModal: true)
|
presented = true
|
||||||
strongSelf.present(controller, in: .window(.root), with: ViewControllerPresentationArguments(presentationAnimation: .modalSheet), blockInteraction: true)
|
strongSelf.push(storageUsageController(context: strongSelf.context, isModal: true))
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
actionSheet.setItemGroups([ActionSheetItemGroup(items: items), ActionSheetItemGroup(items: [
|
actionSheet.setItemGroups([ActionSheetItemGroup(items: items), ActionSheetItemGroup(items: [
|
||||||
ActionSheetButtonItem(title: self.presentationData.strings.Common_Cancel, color: .accent, font: .bold, action: { [weak actionSheet] in
|
ActionSheetButtonItem(title: self.presentationData.strings.Common_Cancel, color: .accent, font: .bold, action: { [weak actionSheet] in
|
||||||
actionSheet?.dismissAnimated()
|
actionSheet?.dismissAnimated()
|
||||||
|
|
||||||
})
|
})
|
||||||
])])
|
])])
|
||||||
self.chatDisplayNode.dismissInput()
|
self.chatDisplayNode.dismissInput()
|
||||||
self.presentInGlobalOverlay(actionSheet)
|
self.presentInGlobalOverlay(actionSheet)
|
||||||
//self.present(actionSheet, in: .window(.root))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@available(iOSApplicationExtension 11.0, iOS 11.0, *)
|
@available(iOSApplicationExtension 11.0, iOS 11.0, *)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user