Download user when we need them

This commit is contained in:
Nathan Mattes 2023-06-01 16:07:45 +02:00
parent 06c72a022a
commit ca61d29ae2
1 changed files with 6 additions and 0 deletions

View File

@ -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()