mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Pre-release improvements
This commit is contained in:
@@ -183,7 +183,7 @@ private enum NotificationSoundSelectionEntry: ItemListNodeEntry {
|
||||
return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section)
|
||||
case let .uploadSound(text):
|
||||
let icon = PresentationResourcesItemList.uploadToneIcon(presentationData.theme)
|
||||
return ItemListCheckboxItem(presentationData: presentationData, icon: icon, iconSize: nil, iconPlacement: .check, title: text, style: .left, checked: false, zeroSeparatorInsets: false, sectionId: self.section, action: {
|
||||
return ItemListCheckboxItem(presentationData: presentationData, icon: icon, iconSize: nil, iconPlacement: .check, title: text, style: .left, textColor: .accent, checked: false, zeroSeparatorInsets: false, sectionId: self.section, action: {
|
||||
arguments.upload()
|
||||
})
|
||||
case let .cloudInfo(text):
|
||||
@@ -479,6 +479,20 @@ public func presentCustomNotificationSoundFilePicker(context: AccountContext, co
|
||||
return
|
||||
}
|
||||
|
||||
do {
|
||||
let resources = try url.resourceValues(forKeys:[.fileSizeKey])
|
||||
if let size = resources.fileSize {
|
||||
if Int32(size) > settings.maxSize {
|
||||
//TODO:localize
|
||||
presentUndo(.info(title: "Audio is too large", text: "The file is over \(dataSizeString(Int64(settings.maxSize), formatting: DataSizeStringFormatting(presentationData: presentationData)))."))
|
||||
return
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
print("Error: \(error)")
|
||||
return
|
||||
}
|
||||
|
||||
let coordinator = NSFileCoordinator(filePresenter: nil)
|
||||
var error: NSError?
|
||||
coordinator.coordinate(readingItemAt: url, options: .forUploading, error: &error, byAccessor: { url in
|
||||
|
||||
Reference in New Issue
Block a user