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

(cherry picked from commit b6fbcf2e7c)

Co-authored-by: Ashish Bhate <bhate.ashish@gmail.com>
This commit is contained in:
Mattermost Build 2020-09-25 04:22:47 -04:00 committed by GitHub
parent dbefec6f17
commit d67b7a2deb
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",