From 997d82047eac1fc8c930aa42c7ca01a7bf6e18f2 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Thu, 5 Jan 2023 13:27:04 +0100 Subject: [PATCH] Make Meta.original optional --- Packages/Models/Sources/Models/MediaAttachement.swift | 2 +- .../Status/Sources/Status/Row/StatusMediaPreviewView.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Packages/Models/Sources/Models/MediaAttachement.swift b/Packages/Models/Sources/Models/MediaAttachement.swift index 30a06db3..939ed29a 100644 --- a/Packages/Models/Sources/Models/MediaAttachement.swift +++ b/Packages/Models/Sources/Models/MediaAttachement.swift @@ -7,7 +7,7 @@ public struct MediaAttachement: Codable, Identifiable, Hashable { public let width: Int? public let height: Int? } - public let original: Meta + public let original: Meta? } public enum SupportedType: String { diff --git a/Packages/Status/Sources/Status/Row/StatusMediaPreviewView.swift b/Packages/Status/Sources/Status/Row/StatusMediaPreviewView.swift index d6163451..7083bd35 100644 --- a/Packages/Status/Sources/Status/Row/StatusMediaPreviewView.swift +++ b/Packages/Status/Sources/Status/Row/StatusMediaPreviewView.swift @@ -31,8 +31,8 @@ public struct StatusMediaPreviewView: View { if isCompact { return .init(width: 50, height: 50) } - if let width = media.meta?.original.width, - let height = media.meta?.original.height { + if let width = media.meta?.original?.width, + let height = media.meta?.original?.height { return .init(width: CGFloat(width), height: CGFloat(height)) } return nil