Fix previews

This commit is contained in:
Justin Mazzocchi 2020-08-07 18:16:04 -07:00
parent c8b4e86019
commit 1a6e313abb
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C

View file

@ -30,25 +30,12 @@ extension Defaults {
static let development: Defaults = {
let preferences = Defaults.fresh()
preferences[.recentIdentityID] = devIdentityID
// Do future setup here
return preferences
}()
}
extension MastodonClient {
static func fresh() -> MastodonClient { MastodonClient(configuration: .stubbing) }
static let development: MastodonClient = {
let client = MastodonClient.fresh()
client.instanceURL = devInstanceURL
client.accessToken = devAccessToken
return client
}()
}
extension Account {
static let development = try! decoder.decode(Account.self, from: Data(officialAccountJSON.utf8))
}
@ -82,19 +69,6 @@ extension IdentityDatabase {
}()
}
extension Identity {
static let development: Identity = {
var identity: Identity?
IdentityDatabase.development.identityObservation(id: devIdentityID)
.assertNoFailure()
.sink(receiveValue: { identity = $0 })
.store(in: &cancellables)
return identity!
}()
}
extension AppEnvironment {
static func fresh(
URLSessionConfiguration: URLSessionConfiguration = .stubbing,