Skip to content

Commit

Permalink
Derive only the language code from the Locale objects
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronvegh committed Dec 27, 2024
1 parent 73aeb94 commit fe89e89
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,14 @@ extension ATProtoBluesky {
}

// Locales
let localeIdentifiers = locales.isEmpty ? nil : locales.map { $0.identifier }
let localeIdentifiers: [String]?
if #available(iOS 16, *) {
localeIdentifiers = locales.isEmpty ? nil : locales.compactMap {
$0.language.languageCode?.identifier
}
} else {
localeIdentifiers = locales.isEmpty ? nil : locales.compactMap { $0.languageCode }
}

// Embed
var resolvedEmbed: ATUnion.PostEmbedUnion? = nil
Expand Down

0 comments on commit fe89e89

Please sign in to comment.