Fix previews
This commit is contained in:
parent
c8b4e86019
commit
1a6e313abb
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue