diff --git a/Mastodon/Scene/Account/AccountListViewModel.swift b/Mastodon/Scene/Account/AccountListViewModel.swift index e0aaf97fc..c5bd93f07 100644 --- a/Mastodon/Scene/Account/AccountListViewModel.swift +++ b/Mastodon/Scene/Account/AccountListViewModel.swift @@ -52,7 +52,7 @@ final class AccountListViewModel: NSObject { mastodonAuthenticationFetchedResultsController.delegate = self do { try mastodonAuthenticationFetchedResultsController.performFetch() - authentications = mastodonAuthenticationFetchedResultsController.fetchedObjects?.compactMap { $0.asRecrod } ?? [] + authentications = mastodonAuthenticationFetchedResultsController.fetchedObjects?.compactMap { $0.asRecord } ?? [] } catch { assertionFailure(error.localizedDescription) } @@ -183,7 +183,7 @@ extension AccountListViewModel: NSFetchedResultsControllerDelegate { return } - authentications = mastodonAuthenticationFetchedResultsController.fetchedObjects?.compactMap { $0.asRecrod } ?? [] + authentications = mastodonAuthenticationFetchedResultsController.fetchedObjects?.compactMap { $0.asRecord } ?? [] } } diff --git a/Mastodon/Scene/Profile/ProfileViewController.swift b/Mastodon/Scene/Profile/ProfileViewController.swift index 3ce1fd33a..6c42f7643 100644 --- a/Mastodon/Scene/Profile/ProfileViewController.swift +++ b/Mastodon/Scene/Profile/ProfileViewController.swift @@ -540,7 +540,7 @@ extension ProfileViewController { let composeViewModel = ComposeViewModel( context: context, authContext: viewModel.authContext, - kind: .mention(user: mastodonUser.asRecrod) + kind: .mention(user: mastodonUser.asRecord) ) _ = coordinator.present(scene: .compose(viewModel: composeViewModel), from: self, transition: .modal(animated: true, completion: nil)) } diff --git a/MastodonSDK/Sources/CoreDataStack/Utility/ManagedObjectRecord.swift b/MastodonSDK/Sources/CoreDataStack/Utility/ManagedObjectRecord.swift index 4910145cf..88b08fc3c 100644 --- a/MastodonSDK/Sources/CoreDataStack/Utility/ManagedObjectRecord.swift +++ b/MastodonSDK/Sources/CoreDataStack/Utility/ManagedObjectRecord.swift @@ -32,7 +32,7 @@ public class ManagedObjectRecord: Hashable { } extension Managed where Self: NSManagedObject { - public var asRecrod: ManagedObjectRecord { + public var asRecord: ManagedObjectRecord { return .init(objectID: objectID) } } diff --git a/MastodonSDK/Sources/MastodonCore/Service/AuthenticationService.swift b/MastodonSDK/Sources/MastodonCore/Service/AuthenticationService.swift index 48da254c6..e8cb536ac 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/AuthenticationService.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/AuthenticationService.swift @@ -67,7 +67,7 @@ public final class AuthenticationService: NSObject { try mastodonAuthenticationFetchedResultsController.performFetch() mastodonAuthentications = mastodonAuthenticationFetchedResultsController.fetchedObjects? .sorted(by: { $0.activedAt > $1.activedAt }) - .compactMap { $0.asRecrod } ?? [] + .compactMap { $0.asRecord } ?? [] } catch { assertionFailure(error.localizedDescription) } @@ -148,7 +148,7 @@ extension AuthenticationService: NSFetchedResultsControllerDelegate { mastodonAuthentications = mastodonAuthenticationFetchedResultsController.fetchedObjects? .sorted(by: { $0.activedAt > $1.activedAt }) - .compactMap { $0.asRecrod } ?? [] + .compactMap { $0.asRecord } ?? [] } } diff --git a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewModel.swift b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewModel.swift index 2bf4e26ff..62159667f 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewModel.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewModel.swift @@ -472,7 +472,7 @@ extension ComposeContentViewModel { let managedObjectContext = self.context.managedObjectContext var _author: ManagedObjectRecord? managedObjectContext.performAndWait { - _author = authContext.mastodonAuthenticationBox.authenticationRecord.object(in: managedObjectContext)?.user.asRecrod + _author = authContext.mastodonAuthenticationBox.authenticationRecord.object(in: managedObjectContext)?.user.asRecord } guard let author = _author else { throw AppError.badAuthentication