Fix error when decoding notification that has a status field but is null

This commit is contained in:
Shadowfacts 2022-11-11 18:48:58 -05:00
parent 802a0ac9ba
commit 9d1c3f1410
1 changed files with 1 additions and 5 deletions

View File

@ -30,11 +30,7 @@ public class Notification: Decodable {
} }
self.createdAt = try container.decode(Date.self, forKey: .createdAt) self.createdAt = try container.decode(Date.self, forKey: .createdAt)
self.account = try container.decode(Account.self, forKey: .account) self.account = try container.decode(Account.self, forKey: .account)
if container.contains(.status) { self.status = try container.decodeIfPresent(Status.self, forKey: .status)
self.status = try container.decode(Status.self, forKey: .status)
} else {
self.status = nil
}
} }
public static func dismiss(id notificationID: String) -> Request<Empty> { public static func dismiss(id notificationID: String) -> Request<Empty> {