Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
fixes #29
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcan committed Nov 22, 2023
1 parent 5b5973d commit b37008a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions swiftsky/api/bsky/actorgetPreferences.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ enum ActorDefsPreferencesElem: Codable {
case adultcontent(ActorDefsAdultContentPref)
case contentlabel(ActorDefsContentLabelPref)
case savedfeeds(ActorDefsSavedFeedsPref)

case none
enum CodingKeys: String, CodingKey {
case type = "$type"
}
Expand All @@ -24,7 +24,7 @@ enum ActorDefsPreferencesElem: Codable {
case "app.bsky.actor.defs#savedFeedsPref":
self = try .savedfeeds(.init(from: decoder))
default:
throw NSError(domain: "", code: 0, userInfo: [NSLocalizedDescriptionKey : "ActorDefsPreferencesElem decode failed"])
self = .none
}
}
func encode(to encoder: Encoder) throws {
Expand All @@ -36,6 +36,8 @@ enum ActorDefsPreferencesElem: Codable {
try container.encode(value)
case .savedfeeds(let value):
try container.encode(value)
default:
break
}
}
var feeds: ActorDefsSavedFeedsPref? {
Expand Down

0 comments on commit b37008a

Please sign in to comment.