Move a very specific extension to the one file that uses it

contributes to iOS-319
This commit is contained in:
shannon 2024-11-18 11:39:09 -05:00
parent 2c1e0a6eb9
commit 40ec6e94b2
2 changed files with 13 additions and 13 deletions

View File

@ -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
}
}

View File

@ -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
}
}