Made filtered key optional (#25)

This commit is contained in:
prajeet 2023-01-03 20:00:08 +05:45 committed by GitHub
parent 749c4aef0b
commit 1c827d1f7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@ public protocol AnyStatus {
var visibility: Visibility { get }
var poll: Poll? { get }
var spoilerText: String { get }
var filtered: [Filtered] { get }
var filtered: [Filtered]? { get }
}
@ -69,7 +69,7 @@ public struct Status: AnyStatus, Codable, Identifiable {
public let visibility: Visibility
public let poll: Poll?
public let spoilerText: String
public let filtered: [Filtered]
public let filtered: [Filtered]?
public static func placeholder() -> Status {
.init(id: UUID().uuidString,
@ -128,5 +128,5 @@ public struct ReblogStatus: AnyStatus, Codable, Identifiable {
public let visibility: Visibility
public let poll: Poll?
public let spoilerText: String
public let filtered: [Filtered]
public let filtered: [Filtered]?
}

View File

@ -19,7 +19,7 @@ public class StatusRowViewModel: ObservableObject {
@Published var isFiltered: Bool = false
var filter: Filtered? {
status.reblog?.filtered.first ?? status.filtered.first
status.reblog?.filtered?.first ?? status.filtered?.first
}
var client: Client?