From 843eeed616817ab218e7dab644aa2f050bceb688 Mon Sep 17 00:00:00 2001 From: jinsu kim Date: Mon, 2 Jan 2023 00:26:15 -0800 Subject: [PATCH] Leave data loading to ThreadViewModel --- .../Service/API/APIService+Thread.swift | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Thread.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Thread.swift index e2375e8dc..d655a7e5c 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Thread.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Thread.swift @@ -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 {