diff --git a/Mastodon/Scene/Account/AccountListViewModel.swift b/Mastodon/Scene/Account/AccountListViewModel.swift index 75797fd47..2b8c75b8d 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 15548a5fc..1184fb3d7 100644 --- a/Mastodon/Scene/Profile/ProfileViewController.swift +++ b/Mastodon/Scene/Profile/ProfileViewController.swift @@ -541,7 +541,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/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewModel+Diffable.swift b/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewModel+Diffable.swift index 7d243b1fa..b9eb5a9ae 100644 --- a/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewModel+Diffable.swift +++ b/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewModel+Diffable.swift @@ -33,7 +33,7 @@ extension SearchResultViewModel { userFetchedResultsController.$records, $hashtags ) - .map { statusRecrods, userRecords, hashtags in + .map { statusRecords, userRecords, hashtags in var items: [SearchResultItem] = [] let userItems = userRecords.map { SearchResultItem.user($0) } @@ -42,7 +42,7 @@ extension SearchResultViewModel { let hashtagItems = hashtags.map { SearchResultItem.hashtag(tag: $0) } items.append(contentsOf: hashtagItems) - let statusItems = statusRecrods.map { SearchResultItem.status($0) } + let statusItems = statusRecords.map { SearchResultItem.status($0) } items.append(contentsOf: statusItems) return items 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 0e5160679..00b0e46cd 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/AuthenticationService.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/AuthenticationService.swift @@ -68,7 +68,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) } @@ -149,7 +149,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 61ccd9e3a..3321aeab7 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewModel.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewModel.swift @@ -498,7 +498,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