Merge pull request #637 from AtariDreams/Warning-fix

Fix compiler warnings
This commit is contained in:
Marcus Kida 2023-01-06 13:14:35 +01:00 committed by GitHub
commit ce8bea13cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -199,7 +199,7 @@ extension AttachmentViewModel {
} else {
AttachmentViewModel.logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): attachment processing. Retry \(waitProcessRetryCount)/\(waitProcessRetryLimit)")
await Task.sleep(1_000_000_000 * 3) // 3s
try await Task.sleep(nanoseconds: 1_000_000_000 * 3) // 3s
}
} while waitProcessRetryCount < waitProcessRetryLimit

View File

@ -304,9 +304,14 @@ extension StatusView.ViewModel {
}
let paragraphStyle = statusView.contentMetaText.paragraphStyle
if let language = language {
let direction = Locale.characterDirection(forLanguage: language)
paragraphStyle.alignment = direction == .rightToLeft ? .right : .left
if let language = language {
if #available(iOS 16, *) {
let direction = Locale.Language(identifier: language).characterDirection
paragraphStyle.alignment = direction == .rightToLeft ? .right : .left
} else {
let direction = Locale.characterDirection(forLanguage: language)
paragraphStyle.alignment = direction == .rightToLeft ? .right : .left
};
} else {
paragraphStyle.alignment = .natural
}