[RN] Prepare for LoadingIndicator in LoginDialog

This commit is contained in:
Lyubo Marinov 2017-09-22 15:15:06 -05:00
parent 4e0761a46a
commit 70de9a683f
3 changed files with 9 additions and 5 deletions

View File

@ -52,6 +52,8 @@ export function authenticateAndUpgradeRole(
dispatch(_upgradeRoleFinished(error)); dispatch(_upgradeRoleFinished(error));
}); });
return process;
}; };
} }

View File

@ -216,18 +216,20 @@ class LoginDialog extends Component {
* @returns {void} * @returns {void}
*/ */
_onLogin() { _onLogin() {
const { _conference: conference } = this.props; const { _conference: conference, dispatch } = this.props;
const { username, password } = this.state; const { username, password } = this.state;
const jid = toJid(username, this.props._configHosts); const jid = toJid(username, this.props._configHosts);
let r;
// If there's a conference it means that the connection has succeeded, // If there's a conference it means that the connection has succeeded,
// but authentication is required in order to join the room. // but authentication is required in order to join the room.
if (conference) { if (conference) {
this.props.dispatch( r = dispatch(authenticateAndUpgradeRole(jid, password, conference));
authenticateAndUpgradeRole(jid, password, conference));
} else { } else {
this.props.dispatch(connect(jid, password)); r = dispatch(connect(jid, password));
} }
return r;
} }
} }

View File

@ -45,7 +45,7 @@ export function connect(id: ?string, password: ?string) {
JitsiConnectionEvents.CONNECTION_FAILED, JitsiConnectionEvents.CONNECTION_FAILED,
_onConnectionFailed); _onConnectionFailed);
connection.connect({ return connection.connect({
id, id,
password password
}); });