mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 11:58:32 +00:00
Fix an issue rendering pills in some forks. (#3913)
This commit is contained in:
@@ -104,9 +104,14 @@ struct InfoPlistReader {
|
|||||||
let exportedTypes: [[String: Any]] = infoPlistValue(forKey: Keys.utExportedTypeDeclarationsKey)
|
let exportedTypes: [[String: Any]] = infoPlistValue(forKey: Keys.utExportedTypeDeclarationsKey)
|
||||||
guard let mentionPills = exportedTypes.first(where: { $0[Keys.utDescriptionKey] as? String == Values.mentionPills }),
|
guard let mentionPills = exportedTypes.first(where: { $0[Keys.utDescriptionKey] as? String == Values.mentionPills }),
|
||||||
let utType = mentionPills[Keys.utTypeIdentifierKey] as? String else {
|
let utType = mentionPills[Keys.utTypeIdentifierKey] as? String else {
|
||||||
fatalError("Add properly \(Values.mentionPills) exported type into your target's Info.plst")
|
fatalError("Add properly \(Values.mentionPills) exported type into your target's Info.plist")
|
||||||
}
|
}
|
||||||
return utType
|
|
||||||
|
// The pills type is formed from the baseBundleIdentifier, however weirdly, if a fork sets that with a value
|
||||||
|
// that includes one or more uppercase characters, pill rendering breaks. If we lowercase the type identifier
|
||||||
|
// the bug is fixed, even though the value used in the fork's Info.plist no longer matches the value returned.
|
||||||
|
// Maybe in the future the fork should set their own PILLS_UT_TYPE_IDENTIFIER, but for now this works 🤷♂️🤷♂️🤷♂️
|
||||||
|
return utType.lowercased()
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Private
|
// MARK: - Private
|
||||||
|
|||||||
Reference in New Issue
Block a user