diff --git a/MastodonIntent/Handler/SendPostIntentHandler.swift b/MastodonIntent/Handler/SendPostIntentHandler.swift index c41c85153..920267854 100644 --- a/MastodonIntent/Handler/SendPostIntentHandler.swift +++ b/MastodonIntent/Handler/SendPostIntentHandler.swift @@ -57,7 +57,7 @@ extension SendPostIntentHandler: SendPostIntentHandling { } mastodonAuthentications = [authentication] } else { - mastodonAuthentications = try accounts.mastodonAuthentication() + mastodonAuthentications = try accounts.mastodonAuthentications() } let authenticationBoxes = mastodonAuthentications.map { authentication in @@ -152,3 +152,15 @@ extension SendPostIntentHandler: SendPostIntentHandling { } } + +extension Array where Element == Account { + @MainActor + func mastodonAuthentications() throws -> [MastodonAuthentication] { + let identifiers = self + .compactMap { $0.identifier } + .compactMap { UUID(uuidString: $0) } + let results = AuthenticationServiceProvider.shared.authentications.filter({ identifiers.contains($0.identifier) }) + return results + } + +} diff --git a/MastodonIntent/Model/Account+Fetch.swift b/MastodonIntent/Model/Account+Fetch.swift index ab16e1ffc..aeeaec52a 100644 --- a/MastodonIntent/Model/Account+Fetch.swift +++ b/MastodonIntent/Model/Account+Fetch.swift @@ -34,15 +34,3 @@ extension Account { } } - -extension Array where Element == Account { - @MainActor - func mastodonAuthentication() throws -> [MastodonAuthentication] { - let identifiers = self - .compactMap { $0.identifier } - .compactMap { UUID(uuidString: $0) } - let results = AuthenticationServiceProvider.shared.authentications.filter({ identifiers.contains($0.identifier) }) - return results - } - -}