Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions GenericApp/GenericApp/UI/WizardDomainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,18 @@ extension WizardDomainViewController: UITextFieldDelegate {
}

fileprivate func requestAppConfig(_ domain: String) {
configManager = ConfigManager(apiManagerFactory: { url in
HttpApiManager(baseUrl: url)
})

async {
do {
configManager = ConfigManager(apiManagerFactory: { url in
try HttpApiManager(baseUrl: url)
})

let state = try await configManager!.setDomain(domain: domain)
print("State \(state)")
switch state {
case .selectDomain:
// Something wrong, we just set the domain
let alertView = UIAlertController(title: "Error", message: "Error occurred getting app config. Check your input and try again", preferredStyle: .alert)
let alertView = UIAlertController(title: "Error", message: "Error occurred getting app config.\nCheck your input and try again.", preferredStyle: .alert)
alertView.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))

self.present(alertView, animated: true, completion: nil)
Expand All @@ -113,8 +113,12 @@ extension WizardDomainViewController: UITextFieldDelegate {
case.complete:
self.performSegue(withIdentifier: Segues.goToWebView, sender: self)
}
} catch ApiManagerError.invalidUrl {
let alertView = UIAlertController(title: "Error", message: "Invalid domain.\nCheck your input and try again.", preferredStyle: .alert)
alertView.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
self.present(alertView, animated: true, completion: nil)
} catch {
let alertView = UIAlertController(title: "Error", message: "Error occurred getting app config. Check your input and try again", preferredStyle: .alert)
let alertView = UIAlertController(title: "Error", message: "Error occurred getting app config.\nCheck your input and try again.", preferredStyle: .alert)
alertView.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
self.present(alertView, animated: true, completion: nil)
}
Expand Down