Skip to content

Commit

Permalink
LoginVC: show alert if server url has no protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
BLeeEZ committed Feb 23, 2021
1 parent 98e2aa8 commit 1685a98
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Amperfy/Screens/ViewController/LoginVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class LoginVC: UIViewController {

func login() {
guard let serverUrl = serverUrlTF.text, !serverUrl.isEmpty else {
showErrorMsg(message: "No server address given!")
showErrorMsg(message: "No server url given!")
return
}
guard serverUrl.hasPrefix("https://") || serverUrl.hasPrefix("http://") else {
showErrorMsg(message: "Please provide either 'https://' or 'http://' in your server url.")
return
}
guard let username = usernameTF.text, !username.isEmpty else {
Expand Down

0 comments on commit 1685a98

Please sign in to comment.