From ca61d29ae20674426974a2c5b6bdec32391061be Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Thu, 1 Jun 2023 16:07:45 +0200 Subject: [PATCH] Download user when we need them --- .../MastodonCore/Service/API/APIService+HomeTimeline.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HomeTimeline.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HomeTimeline.swift index 7fddc8344..91d053d5b 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HomeTimeline.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HomeTimeline.swift @@ -39,6 +39,12 @@ extension APIService { ).singleOutput() let managedObjectContext = self.backgroundManagedObjectContext + + // FIXME: This is a dirty hack to make the performance-stuff work. + // Problem is, that we don't persist the user on disk anymore. So we have to fetch + // it when we need it to display on the home timeline. + _ = try await authenticatedUserInfo(authenticationBox: authenticationBox).value + try await managedObjectContext.performChanges { guard let me = authenticationBox.authentication.user(in: managedObjectContext) else { assertionFailure()