From 6f6711458be9b712b9f87b03bd9dbf31e4101ed2 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Mon, 13 Nov 2023 12:53:47 +0100 Subject: [PATCH] Make profile edit-able again --- Mastodon/Scene/Profile/ProfileViewModel.swift | 5 ++--- .../CoreData.xcdatamodeld/CoreData 9.xcdatamodel/contents | 5 ++--- .../Sources/CoreDataStack/Entity/Mastodon/MastodonUser.swift | 1 - 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Mastodon/Scene/Profile/ProfileViewModel.swift b/Mastodon/Scene/Profile/ProfileViewModel.swift index 012ebf61b..630205371 100644 --- a/Mastodon/Scene/Profile/ProfileViewModel.swift +++ b/Mastodon/Scene/Profile/ProfileViewModel.swift @@ -178,12 +178,11 @@ class ProfileViewModel: NSObject { // fetch profile info before edit func fetchEditProfileInfo() -> AnyPublisher, Error> { - guard let me = me, - let mastodonAuthentication = me.mastodonAuthentication - else { + guard let me else { return Fail(error: APIService.APIError.implicit(.authenticationMissing)).eraseToAnyPublisher() } + let mastodonAuthentication = authContext.mastodonAuthenticationBox.authentication let authorization = Mastodon.API.OAuth.Authorization(accessToken: mastodonAuthentication.userAccessToken) return context.apiService.accountVerifyCredentials(domain: me.domain, authorization: authorization) } diff --git a/MastodonSDK/Sources/CoreDataStack/CoreData.xcdatamodeld/CoreData 9.xcdatamodel/contents b/MastodonSDK/Sources/CoreDataStack/CoreData.xcdatamodeld/CoreData 9.xcdatamodel/contents index c5bbd1485..ee9d4b157 100644 --- a/MastodonSDK/Sources/CoreDataStack/CoreData.xcdatamodeld/CoreData 9.xcdatamodel/contents +++ b/MastodonSDK/Sources/CoreDataStack/CoreData.xcdatamodeld/CoreData 9.xcdatamodel/contents @@ -1,5 +1,5 @@ - + @@ -78,7 +78,7 @@ - + @@ -116,7 +116,6 @@ - diff --git a/MastodonSDK/Sources/CoreDataStack/Entity/Mastodon/MastodonUser.swift b/MastodonSDK/Sources/CoreDataStack/Entity/Mastodon/MastodonUser.swift index 83f94fd22..da066c576 100644 --- a/MastodonSDK/Sources/CoreDataStack/Entity/Mastodon/MastodonUser.swift +++ b/MastodonSDK/Sources/CoreDataStack/Entity/Mastodon/MastodonUser.swift @@ -63,7 +63,6 @@ final public class MastodonUser: NSManagedObject { // one-to-one relationship @NSManaged public private(set) var pinnedStatus: Status? - @NSManaged public private(set) var mastodonAuthentication: MastodonAuthenticationLegacy? // one-to-many relationship @NSManaged public private(set) var statuses: Set