Don't try to log in if the server string isn't valid

This commit is contained in:
Angelo Stavrow 2021-02-02 11:40:01 -05:00
parent de50f3c9a4
commit a354b807fe
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE

View File

@ -71,14 +71,14 @@ struct AccountLoginView: View {
hostURL.scheme = scheme hostURL.scheme = scheme
hostURL.host = host hostURL.host = host
server = hostURL.string ?? server server = hostURL.string ?? server
model.login(
to: URL(string: server)!,
as: username, password: password
)
} else { } else {
model.loginErrorMessage = AccountError.invalidServerURL.localizedDescription model.loginErrorMessage = AccountError.invalidServerURL.localizedDescription
model.isPresentingLoginErrorAlert = true model.isPresentingLoginErrorAlert = true
} }
model.login(
to: URL(string: server)!,
as: username, password: password
)
}, label: { }, label: {
Text("Log In") Text("Log In")
}) })