Model: Allow creating an interface with empty name
But don't allow such a tunnel to be added to the tunnel manager. (We'll need to create an interface with an empty name when we're reading QR codes.) Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
@@ -98,7 +98,7 @@ class TunnelViewModel {
|
||||
|
||||
func save() -> SaveResult<InterfaceConfiguration> {
|
||||
fieldsWithError.removeAll()
|
||||
guard let name = scratchpad[.name] else {
|
||||
guard let name = scratchpad[.name], (!name.isEmpty) else {
|
||||
fieldsWithError.insert(.name)
|
||||
return .error("Interface name is required")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user