mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2024-12-16 10:48:49 +01:00
Leave data loading to ThreadViewModel
This commit is contained in:
parent
5c82c04232
commit
843eeed616
@ -81,31 +81,31 @@ extension APIService {
|
||||
)
|
||||
}
|
||||
|
||||
let responseTwo = try await Mastodon.API.Statuses.statusContext(
|
||||
session: session,
|
||||
domain: domain,
|
||||
statusID: statusID,
|
||||
authorization: authorization
|
||||
).singleOutput()
|
||||
|
||||
try await managedObjectContext.performChanges {
|
||||
let me = authenticationBox.authenticationRecord.object(in: managedObjectContext)?.user
|
||||
let value = responseTwo.value.ancestors + responseTwo.value.descendants
|
||||
|
||||
for entity in value {
|
||||
_ = Persistence.Status.createOrMerge(
|
||||
in: managedObjectContext,
|
||||
context: Persistence.Status.PersistContext(
|
||||
domain: domain,
|
||||
entity: entity,
|
||||
me: me,
|
||||
statusCache: nil,
|
||||
userCache: nil,
|
||||
networkDate: responseTwo.networkDate
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
// let responseTwo = try await Mastodon.API.Statuses.statusContext(
|
||||
// session: session,
|
||||
// domain: domain,
|
||||
// statusID: statusID,
|
||||
// authorization: authorization
|
||||
// ).singleOutput()
|
||||
//
|
||||
// try await managedObjectContext.performChanges {
|
||||
// let me = authenticationBox.authenticationRecord.object(in: managedObjectContext)?.user
|
||||
// let value = responseTwo.value.ancestors + responseTwo.value.descendants
|
||||
//
|
||||
// for entity in value {
|
||||
// _ = Persistence.Status.createOrMerge(
|
||||
// in: managedObjectContext,
|
||||
// context: Persistence.Status.PersistContext(
|
||||
// domain: domain,
|
||||
// entity: entity,
|
||||
// me: me,
|
||||
// statusCache: nil,
|
||||
// userCache: nil,
|
||||
// networkDate: responseTwo.networkDate
|
||||
// )
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
|
||||
var result: Status?
|
||||
try await managedObjectContext.perform {
|
||||
|
Loading…
Reference in New Issue
Block a user