Fix translate not working (IOS-176)

This commit is contained in:
Marcus Kida 2023-11-28 09:41:34 +01:00
parent a322a46fdf
commit 167e0e4616
No known key found for this signature in database
GPG Key ID: 19FF64E08013CA40
1 changed files with 3 additions and 2 deletions

View File

@ -465,13 +465,14 @@ extension StatusTableViewCellDelegate where Self: DataSourceProvider & AuthConte
assertionFailure() assertionFailure()
return return
} }
guard case let .status(status) = item else { guard case let .status(_status) = item else {
assertionFailure("only works for status data provider") assertionFailure("only works for status data provider")
return return
} }
let _author: ManagedObjectRecord<MastodonUser>? = try await self.context.managedObjectContext.perform { let _author: ManagedObjectRecord<MastodonUser>? = try await self.context.managedObjectContext.perform {
let status = _status.reblog ?? _status
let request = MastodonUser.sortedFetchRequest let request = MastodonUser.sortedFetchRequest
request.predicate = MastodonUser.predicate(domain: status.entity.account.domain ?? "", id: status.entity.account.id) request.predicate = MastodonUser.predicate(domain: self.authContext.mastodonAuthenticationBox.domain, id: status.entity.account.id)
request.fetchLimit = 1 request.fetchLimit = 1
guard let author = self.context.managedObjectContext.safeFetch(request).first else { return nil } guard let author = self.context.managedObjectContext.safeFetch(request).first else { return nil }
return .init(objectID: author.objectID) return .init(objectID: author.objectID)