Make Meta.original optional

This commit is contained in:
Thomas Ricouard 2023-01-05 13:27:04 +01:00
parent 33ce6eadc2
commit 997d82047e
2 changed files with 3 additions and 3 deletions

View file

@ -7,7 +7,7 @@ public struct MediaAttachement: Codable, Identifiable, Hashable {
public let width: Int? public let width: Int?
public let height: Int? public let height: Int?
} }
public let original: Meta public let original: Meta?
} }
public enum SupportedType: String { public enum SupportedType: String {

View file

@ -31,8 +31,8 @@ public struct StatusMediaPreviewView: View {
if isCompact { if isCompact {
return .init(width: 50, height: 50) return .init(width: 50, height: 50)
} }
if let width = media.meta?.original.width, if let width = media.meta?.original?.width,
let height = media.meta?.original.height { let height = media.meta?.original?.height {
return .init(width: CGFloat(width), height: CGFloat(height)) return .init(width: CGFloat(width), height: CGFloat(height))
} }
return nil return nil