Fix loading local time line (#34)

This commit is contained in:
Sean Goldin 2023-01-06 14:19:29 -06:00 committed by GitHub
parent 7f5330f284
commit 79febd92e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -8,6 +8,15 @@ public struct Application: Codable, Identifiable {
public let website: URL?
}
extension Application {
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: CodingKeys.self)
name = try values.decodeIfPresent(String.self, forKey: .name) ?? ""
website = try? values.decodeIfPresent(URL.self, forKey: .website)
}
}
public enum Visibility: String, Codable, CaseIterable {
case pub = "public"
case unlisted