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
|
||||
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.removesConfigurationOnCancel = true
|
||||
return
|
||||
|
|
|
@ -87,12 +87,7 @@ class WizardHostViewController: UITableViewController, TableModelHost {
|
|||
// MARK: Actions
|
||||
|
||||
private func useSuggestedTitle() {
|
||||
guard let field = cellTitle?.field else {
|
||||
return
|
||||
}
|
||||
if field.text?.isEmpty ?? true {
|
||||
field.text = parsedFile?.url.normalizedFilename
|
||||
}
|
||||
cellTitle?.field.text = parsedFile?.url.normalizedFilename
|
||||
}
|
||||
|
||||
@IBAction private func next() {
|
||||
|
|
Loading…
Reference in New Issue