diff --git a/submodules/SettingsUI/Sources/Data and Storage/StorageUsageController.swift b/submodules/SettingsUI/Sources/Data and Storage/StorageUsageController.swift index 34410822f1..b2f9f2a5b1 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/StorageUsageController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/StorageUsageController.swift @@ -531,7 +531,7 @@ public func storageUsageController(context: AccountContext, isModal: Bool = fals clearDisposable.set((signal |> deliverOnMainQueue).start(completed: { statsPromise.set(.single(.result(resultStats))) - var deviceName = "iPhone" + let deviceName = UIDevice.current.userInterfaceIdiom == .pad ? "iPad" : "iPhone" presentControllerImpl?(UndoOverlayController(presentationData: presentationData, content: .succeed(text: presentationData.strings.ClearCache_Success("\(dataSizeString(totalSize, decimalSeparator: presentationData.dateTimeFormat.decimalSeparator))", deviceName).0), elevatedLayout: false, action: { _ in }), nil) })) } @@ -710,8 +710,8 @@ public func storageUsageController(context: AccountContext, isModal: Bool = fals clearDisposable.set((signal |> deliverOnMainQueue).start(completed: { statsPromise.set(.single(.result(resultStats))) - - presentControllerImpl?(UndoOverlayController(presentationData: presentationData, content: .succeed(text: presentationData.strings.ClearCache_Success("\(dataSizeString(totalSize, decimalSeparator: presentationData.dateTimeFormat.decimalSeparator))", "").0), elevatedLayout: false, action: { _ in }), nil) + let deviceName = UIDevice.current.userInterfaceIdiom == .pad ? "iPad" : "iPhone" + presentControllerImpl?(UndoOverlayController(presentationData: presentationData, content: .succeed(text: presentationData.strings.ClearCache_Success("\(dataSizeString(totalSize, decimalSeparator: presentationData.dateTimeFormat.decimalSeparator))", deviceName).0), elevatedLayout: false, action: { _ in }), nil) })) } diff --git a/submodules/TelegramUI/TelegramUI/ChatController.swift b/submodules/TelegramUI/TelegramUI/ChatController.swift index 73d3e492a1..7fa50734eb 100644 --- a/submodules/TelegramUI/TelegramUI/ChatController.swift +++ b/submodules/TelegramUI/TelegramUI/ChatController.swift @@ -5249,13 +5249,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G clearDisposable.set((signal |> deliverOnMainQueue).start(completed: { [weak self] in if let strongSelf = self, let layout = strongSelf.validLayout { - var deviceName: String - switch layout.deviceMetrics.type { - case .tablet: - deviceName = "iPad" - default: - deviceName = "iPhone" - } + let deviceName = UIDevice.current.userInterfaceIdiom == .pad ? "iPad" : "iPhone" strongSelf.present(UndoOverlayController(presentationData: presentationData, content: .succeed(text: presentationData.strings.ClearCache_Success("\(dataSizeString(totalSize, decimalSeparator: presentationData.dateTimeFormat.decimalSeparator))", deviceName).0), elevatedLayout: true, action: { _ in }), in: .window(.root)) } }))