mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 15:22:39 +00:00
Fix: do not encode the maximum width of a Pill
This commit is contained in:
parent
97762330b2
commit
334a116a05
1 changed files with 2 additions and 4 deletions
|
@ -96,7 +96,7 @@ struct PillTextAttachmentData: Codable {
|
|||
isHighlighted: Bool,
|
||||
alpha: CGFloat,
|
||||
font: UIFont,
|
||||
maxWidth: CGFloat = CGFloat.greatestFiniteMagnitude) {
|
||||
maxWidth: CGFloat = .greatestFiniteMagnitude) {
|
||||
self.pillType = pillType
|
||||
self.items = items
|
||||
self.isHighlighted = isHighlighted
|
||||
|
@ -112,7 +112,6 @@ struct PillTextAttachmentData: Codable {
|
|||
case isHighlighted
|
||||
case alpha
|
||||
case font
|
||||
case maxWidth
|
||||
}
|
||||
|
||||
enum PillTextAttachmentDataError: Error {
|
||||
|
@ -131,7 +130,7 @@ struct PillTextAttachmentData: Codable {
|
|||
} else {
|
||||
throw PillTextAttachmentDataError.noFontData
|
||||
}
|
||||
maxWidth = try container.decode(CGFloat.self, forKey: .maxWidth)
|
||||
maxWidth = .greatestFiniteMagnitude
|
||||
}
|
||||
|
||||
func encode(to encoder: Encoder) throws {
|
||||
|
@ -142,7 +141,6 @@ struct PillTextAttachmentData: Codable {
|
|||
try container.encode(alpha, forKey: .alpha)
|
||||
let fontData = try NSKeyedArchiver.archivedData(withRootObject: font, requiringSecureCoding: false)
|
||||
try container.encode(fontData, forKey: .font)
|
||||
try container.encode(maxWidth, forKey: .maxWidth)
|
||||
}
|
||||
|
||||
// MARK: - Pill representations
|
||||
|
|
Loading…
Reference in a new issue