Move a very specific extension to the one file that uses it
contributes to iOS-319
This commit is contained in:
parent
2c1e0a6eb9
commit
40ec6e94b2
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue