Various improvements

This commit is contained in:
Ilya Laktyushin
2023-10-22 13:52:38 +04:00
parent b5bede3d8b
commit df505a7b62
28 changed files with 292 additions and 275 deletions

View File

@@ -540,7 +540,7 @@ public func presentCustomNotificationSoundFilePicker(context: AccountContext, co
let data = try Data(contentsOf: url)
if data.count > settings.maxSize {
presentUndo(.info(title: presentationData.strings.Notifications_UploadError_TooLarge_Title, text: presentationData.strings.Notifications_UploadError_TooLarge_Text(dataSizeString(Int64(settings.maxSize), formatting: DataSizeStringFormatting(presentationData: presentationData))).string, timeout: nil))
presentUndo(.info(title: presentationData.strings.Notifications_UploadError_TooLarge_Title, text: presentationData.strings.Notifications_UploadError_TooLarge_Text(dataSizeString(Int64(settings.maxSize), formatting: DataSizeStringFormatting(presentationData: presentationData))).string, timeout: nil, customUndoText: nil))
souceUrl.stopAccessingSecurityScopedResource()
EngineTempBox.shared.dispose(tempFile)
@@ -593,7 +593,7 @@ public func presentCustomNotificationSoundFilePicker(context: AccountContext, co
if duration > Double(settings.maxDuration) {
souceUrl.stopAccessingSecurityScopedResource()
presentUndo(.info(title: presentationData.strings.Notifications_UploadError_TooLong_Title(fileName).string, text: presentationData.strings.Notifications_UploadError_TooLong_Text(stringForDuration(Int32(settings.maxDuration))).string, timeout: nil))
presentUndo(.info(title: presentationData.strings.Notifications_UploadError_TooLong_Title(fileName).string, text: presentationData.strings.Notifications_UploadError_TooLong_Text(stringForDuration(Int32(settings.maxDuration))).string, timeout: nil, customUndoText: nil))
} else {
Logger.shared.log("NotificationSoundSelection", "Uploading sound")