Fix index caching in Core

This commit is contained in:
Davide De Rosa 2019-11-30 12:27:30 +01:00
parent bbd19427d9
commit 89b638eaa3
3 changed files with 20 additions and 4 deletions

View File

@ -1048,6 +1048,12 @@ internal enum L10n {
}
}
internal enum Provider {
internal enum Alerts {
internal enum Unavailable {
/// Could not download provider infrastructure, please retry later.
internal static let message = L10n.tr("Core", "wizards.provider.alerts.unavailable.message")
}
}
internal enum Cells {
internal enum UpdateList {
/// Update list

View File

@ -96,11 +96,21 @@ class WizardProviderViewController: UITableViewController, StrongTableHost {
}
private func alertMissingInfrastructure(forName name: Infrastructure.Name, error: Error?) {
log.error("Unable to download missing \(name) infrastructure: \(error?.localizedDescription ?? "")")
let alert = UIAlertController.asAlert(title, "..........")
var message = L10n.Core.Wizards.Provider.Alerts.Unavailable.message
if let error = error {
log.error("Unable to download missing \(name) infrastructure (network error): \(error.localizedDescription)")
message.append(" \(error.localizedDescription)")
} else {
log.error("Unable to download missing \(name) infrastructure (API error)")
}
let alert = UIAlertController.asAlert(name, message)
alert.addCancelAction(L10n.Core.Global.ok)
present(alert, animated: true, completion: nil)
if let ip = tableView.indexPathForSelectedRow {
tableView.deselectRow(at: ip, animated: true)
}
}
private func finish(withCredentials credentials: Credentials) {

@ -1 +1 @@
Subproject commit 725a121ed811fc014267ebf1e4307a10ab570639
Subproject commit ad0c3922813e0e7261e2e90e8386604abb5cd9c5