Overwrite pending profile when reimporting
- Overwrite title field - Remove old .ovpn useSuggestedTitle() is only called on load, it will never overwrite user input unless there's a new import.
This commit is contained in:
parent
c084c71db3
commit
06ecd3367f
|
@ -115,6 +115,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
|
||||||
|
|
||||||
// already presented: update parsed configuration
|
// already presented: update parsed configuration
|
||||||
if let nav = target as? UINavigationController, let wizard = nav.topViewController as? WizardHostViewController {
|
if let nav = target as? UINavigationController, let wizard = nav.topViewController as? WizardHostViewController {
|
||||||
|
if let oldURL = wizard.parsedFile?.url {
|
||||||
|
try? FileManager.default.removeItem(at: oldURL)
|
||||||
|
}
|
||||||
wizard.parsedFile = parsedFile
|
wizard.parsedFile = parsedFile
|
||||||
wizard.removesConfigurationOnCancel = true
|
wizard.removesConfigurationOnCancel = true
|
||||||
return
|
return
|
||||||
|
|
|
@ -87,12 +87,7 @@ class WizardHostViewController: UITableViewController, TableModelHost {
|
||||||
// MARK: Actions
|
// MARK: Actions
|
||||||
|
|
||||||
private func useSuggestedTitle() {
|
private func useSuggestedTitle() {
|
||||||
guard let field = cellTitle?.field else {
|
cellTitle?.field.text = parsedFile?.url.normalizedFilename
|
||||||
return
|
|
||||||
}
|
|
||||||
if field.text?.isEmpty ?? true {
|
|
||||||
field.text = parsedFile?.url.normalizedFilename
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@IBAction private func next() {
|
@IBAction private func next() {
|
||||||
|
|
Loading…
Reference in New Issue