Move name from interface to tunnel
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
@@ -23,7 +23,7 @@ class ZipExporter {
|
||||
var lastTunnelName: String = ""
|
||||
for tunnelConfiguration in tunnelConfigurations {
|
||||
if let contents = tunnelConfiguration.asWgQuickConfig().data(using: .utf8) {
|
||||
let name = tunnelConfiguration.interface.name ?? ""
|
||||
let name = tunnelConfiguration.name ?? "untitled"
|
||||
if name.isEmpty || name == lastTunnelName { continue }
|
||||
inputsToArchiver.append((fileName: "\(name).conf", contents: contents))
|
||||
lastTunnelName = name
|
||||
|
||||
@@ -44,7 +44,7 @@ class ZipImporter {
|
||||
continue
|
||||
}
|
||||
guard let fileContents = String(data: file.contents, encoding: .utf8) else { continue }
|
||||
guard let tunnelConfig = try? TunnelConfiguration(fileContents, name: file.fileBaseName) else { continue }
|
||||
guard let tunnelConfig = try? TunnelConfiguration(fromWgQuickConfig: fileContents, called: file.fileBaseName) else { continue }
|
||||
configs[index] = tunnelConfig
|
||||
}
|
||||
DispatchQueue.main.async { completion(.success(configs)) }
|
||||
|
||||
Reference in New Issue
Block a user