diff --git a/submodules/SettingsUI/Sources/Data and Storage/StorageUsageController.swift b/submodules/SettingsUI/Sources/Data and Storage/StorageUsageController.swift index 2adb683ad5..c76f1bd8a1 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/StorageUsageController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/StorageUsageController.swift @@ -933,6 +933,9 @@ public func storageUsageController(context: AccountContext, cacheUsagePromise: P } let controller = ItemListController(context: context, state: signal) + if isModal { + controller.navigationPresentation = .modal + } presentControllerImpl = { [weak controller] c, contextType, a in controller?.present(c, in: contextType, with: a) } diff --git a/submodules/TelegramUI/TelegramUI/ChatController.swift b/submodules/TelegramUI/TelegramUI/ChatController.swift index 8f754321bd..4aad37a68b 100644 --- a/submodules/TelegramUI/TelegramUI/ChatController.swift +++ b/submodules/TelegramUI/TelegramUI/ChatController.swift @@ -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)) + var presented = false items.append(ActionSheetButtonItem(title: self.presentationData.strings.ClearCache_FreeSpace, color: .accent, action: { [weak self, weak actionSheet] in actionSheet?.dismissAnimated() - if let strongSelf = self { - let controller = storageUsageController(context: strongSelf.context, isModal: true) - strongSelf.present(controller, in: .window(.root), with: ViewControllerPresentationArguments(presentationAnimation: .modalSheet), blockInteraction: true) + if let strongSelf = self, !presented { + presented = true + strongSelf.push(storageUsageController(context: strongSelf.context, isModal: true)) } })) actionSheet.setItemGroups([ActionSheetItemGroup(items: items), ActionSheetItemGroup(items: [ ActionSheetButtonItem(title: self.presentationData.strings.Common_Cancel, color: .accent, font: .bold, action: { [weak actionSheet] in actionSheet?.dismissAnimated() - }) ])]) self.chatDisplayNode.dismissInput() self.presentInGlobalOverlay(actionSheet) - //self.present(actionSheet, in: .window(.root)) } @available(iOSApplicationExtension 11.0, iOS 11.0, *)