Move available providers to Core

This commit is contained in:
Davide De Rosa 2019-06-28 19:10:42 +02:00
parent b45479a733
commit 60b60646d4
2 changed files with 3 additions and 13 deletions

View File

@ -183,16 +183,7 @@ class OrganizerViewController: UITableViewController, TableModelHost {
} }
private func addNewProvider() { private func addNewProvider() {
var names = Set(InfrastructureFactory.shared.allNames) let names = service.availableProviderNames()
var createdNames: [Infrastructure.Name] = []
providers.forEach {
guard let name = Infrastructure.Name(rawValue: $0) else {
return
}
createdNames.append(name)
}
names.formSymmetricDifference(createdNames)
guard !names.isEmpty else { guard !names.isEmpty else {
let alert = Macros.alert( let alert = Macros.alert(
L10n.Core.Organizer.Sections.Providers.header, L10n.Core.Organizer.Sections.Providers.header,
@ -202,8 +193,7 @@ class OrganizerViewController: UITableViewController, TableModelHost {
present(alert, animated: true, completion: nil) present(alert, animated: true, completion: nil)
return return
} }
availableProviderNames = names
availableProviderNames = names.sorted()
perform(segue: StoryboardSegue.Organizer.addProviderSegueIdentifier) perform(segue: StoryboardSegue.Organizer.addProviderSegueIdentifier)
} }

@ -1 +1 @@
Subproject commit 2b5b2e547384886d3fb04ada7e926c618c443629 Subproject commit a651c693a66ca0ca3c6bb796a023ebd390d5cb3a