[MM-23909] better error message if url is empty (#4821)

This commit is contained in:
Ashish Bhate 2020-09-25 08:52:28 +05:30 committed by GitHub
parent 7647367bcf
commit b6fbcf2e7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View file

@ -206,6 +206,19 @@ export default class SelectServer extends PureComponent {
return;
}
if (!this.state.url || this.state.url.trim() === '') {
this.setState({
error: {
intl: {
id: t('mobile.server_url.empty'),
defaultMessage: 'Please enter a valid server URL',
},
},
});
return;
}
if (!isValidUrl(this.sanitizeUrl(this.state.url))) {
this.setState({
error: {

View file

@ -479,6 +479,7 @@
"mobile.server_upgrade.dismiss": "Dismiss",
"mobile.server_upgrade.learn_more": "Learn More",
"mobile.server_upgrade.title": "Server upgrade required",
"mobile.server_url.empty": "Please enter a valid server URL",
"mobile.server_url.invalid_format": "URL must start with http:// or https://",
"mobile.session_expired": "Session Expired: Please log in to continue receiving notifications. Sessions for {siteName} are configured to expire every {daysCount, number} {daysCount, plural, one {day} other {days}}.",
"mobile.set_status.away": "Away",