From ed8ce287086f0293718bcd8418cec75e1e8f5f56 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 30 May 2018 13:51:30 -0300 Subject: [PATCH] Fix for "java.lang.IllegalArgumentException: unexpected url" (#313) @RocketChat/ReactNative User was able to add an invalid instance of Rocket.Chat by pressing submit button instead of "Connect" button. --- app/views/NewServerView.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/NewServerView.js b/app/views/NewServerView.js index 684badf8..28562495 100644 --- a/app/views/NewServerView.js +++ b/app/views/NewServerView.js @@ -48,8 +48,10 @@ export default class NewServerView extends LoggedView { } submit = () => { - Keyboard.dismiss(); - this.props.addServer(this.completeUrl(this.state.text)); + if (this.props.validInstance) { + Keyboard.dismiss(); + this.props.addServer(this.completeUrl(this.state.text)); + } } completeUrl = (url) => {