Fix for "java.lang.IllegalArgumentException: unexpected url" (#313)
<!-- INSTRUCTION: Keep the line below to notify all core developers about this new PR --> @RocketChat/ReactNative <!-- INSTRUCTION: Inform the issue number that this PR closes, or remove the line below --> User was able to add an invalid instance of Rocket.Chat by pressing submit button instead of "Connect" button. <!-- INSTRUCTION: Tell us more about your PR with screen shots if you can -->
This commit is contained in:
parent
3b278f47ce
commit
ed8ce28708
|
@ -48,9 +48,11 @@ export default class NewServerView extends LoggedView {
|
||||||
}
|
}
|
||||||
|
|
||||||
submit = () => {
|
submit = () => {
|
||||||
|
if (this.props.validInstance) {
|
||||||
Keyboard.dismiss();
|
Keyboard.dismiss();
|
||||||
this.props.addServer(this.completeUrl(this.state.text));
|
this.props.addServer(this.completeUrl(this.state.text));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
completeUrl = (url) => {
|
completeUrl = (url) => {
|
||||||
url = url && url.trim();
|
url = url && url.trim();
|
||||||
|
|
Loading…
Reference in New Issue