mirror of
https://github.com/passepartoutvpn/wireguard-apple.git
synced 2025-01-22 16:42:10 +00:00
Importing: Account for errors in showing the 'No configurations found' error
This commit is contained in:
parent
1889614157
commit
2d6426f798
@ -153,10 +153,6 @@ class TunnelsListTableViewController: UITableViewController {
|
|||||||
} catch (let error) {
|
} catch (let error) {
|
||||||
print("Error opening zip archive: \(error)")
|
print("Error opening zip archive: \(error)")
|
||||||
}
|
}
|
||||||
guard (unarchivedFiles.count > 0) else {
|
|
||||||
showErrorAlert(title: "No configurations found", message: "Zip archive doesn't contain any .conf files")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var numberOfConfigFilesWithErrors = 0
|
var numberOfConfigFilesWithErrors = 0
|
||||||
var tunnelConfigurationsToAdd: [TunnelConfiguration] = []
|
var tunnelConfigurationsToAdd: [TunnelConfiguration] = []
|
||||||
for unarchivedFile in unarchivedFiles {
|
for unarchivedFile in unarchivedFiles {
|
||||||
@ -170,6 +166,10 @@ class TunnelsListTableViewController: UITableViewController {
|
|||||||
numberOfConfigFilesWithErrors = numberOfConfigFilesWithErrors + 1
|
numberOfConfigFilesWithErrors = numberOfConfigFilesWithErrors + 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
guard (tunnelConfigurationsToAdd.count > 0) else {
|
||||||
|
showErrorAlert(title: "No configurations found", message: "Zip archive doesn't contain any valid .conf files")
|
||||||
|
return
|
||||||
|
}
|
||||||
var numberOfTunnelsRemainingAfterError = 0
|
var numberOfTunnelsRemainingAfterError = 0
|
||||||
tunnelsManager?.addMultiple(tunnelConfigurations: tunnelConfigurationsToAdd) { (numberOfTunnelsRemaining, error) in
|
tunnelsManager?.addMultiple(tunnelConfigurations: tunnelConfigurationsToAdd) { (numberOfTunnelsRemaining, error) in
|
||||||
if (error != nil) {
|
if (error != nil) {
|
||||||
|
Loading…
Reference in New Issue
Block a user