mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Don't try to log in if the server string isn't valid
This commit is contained in:
parent
de50f3c9a4
commit
a354b807fe
@ -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")
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user